Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 1 | {{/* |
| 2 | Copyright 2019-present Open Networking Foundation |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */}} |
| 16 | |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame^] | 17 | {{ tuple "enb" . | include "oaisim.service_account" }} |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 18 | --- |
| 19 | apiVersion: apps/v1 |
| 20 | kind: StatefulSet |
| 21 | metadata: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame^] | 22 | name: enb |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 23 | labels: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame^] | 24 | {{ tuple "enb" . | include "oaisim.metadata_labels" | indent 4 }} |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 25 | spec: |
| 26 | replicas: 1 |
| 27 | selector: |
| 28 | matchLabels: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame^] | 29 | {{ tuple "enb" . | include "oaisim.metadata_labels" | indent 6 }} |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 30 | template: |
| 31 | metadata: |
| 32 | labels: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame^] | 33 | {{ tuple "enb" . | include "oaisim.metadata_labels" | indent 8 }} |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 34 | spec: |
Hyunsun Moon | 43eadcc | 2019-08-20 16:16:08 -0600 | [diff] [blame] | 35 | {{- if .Values.nodeSelectors.enabled }} |
| 36 | nodeSelector: |
| 37 | {{ .Values.nodeSelectors.enb.label }}: {{ .Values.nodeSelectors.enb.value }} |
| 38 | {{- end }} |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame^] | 39 | serviceAccountName: enb |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 40 | hostNetwork: true |
| 41 | initContainers: |
| 42 | - name: enb-dep-check |
| 43 | image: {{ .Values.images.tags.dep_check | quote }} |
| 44 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 45 | securityContext: |
| 46 | allowPrivilegeEscalation: false |
| 47 | readOnlyRootFilesystem: false |
| 48 | runAsUser: 0 |
| 49 | env: |
| 50 | - name: POD_NAME |
| 51 | valueFrom: |
| 52 | fieldRef: |
| 53 | apiVersion: v1 |
| 54 | fieldPath: metadata.name |
| 55 | - name: NAMESPACE |
| 56 | valueFrom: |
| 57 | fieldRef: |
| 58 | apiVersion: v1 |
| 59 | fieldPath: metadata.namespace |
| 60 | - name: PATH |
| 61 | value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ |
| 62 | - name: COMMAND |
| 63 | value: "echo done" |
| 64 | - name: DEPENDENCY_POD_JSON |
| 65 | value: '[{"labels": {"app": "mme"}, "requireSameNode": false}]' |
| 66 | command: |
| 67 | - kubernetes-entrypoint |
| 68 | volumeMounts: |
| 69 | [] |
| 70 | - name: enb-init |
| 71 | image: {{ .Values.images.tags.enb | quote }} |
| 72 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 73 | securityContext: |
| 74 | capabilities: |
| 75 | add: |
| 76 | - NET_ADMIN |
| 77 | command: |
| 78 | - /opt/oaisim/enb/scripts/enb-init.sh |
| 79 | env: |
| 80 | - name: ENB_LOCAL_IP |
| 81 | valueFrom: |
| 82 | fieldRef: |
| 83 | fieldPath: status.podIP |
| 84 | volumeMounts: |
| 85 | - name: script |
| 86 | mountPath: /opt/oaisim/enb/scripts/enb-init.sh |
| 87 | subPath: enb-init.sh |
| 88 | - name: config |
| 89 | mountPath: /opt/oaisim/enb/config |
| 90 | - name: pod-share |
| 91 | mountPath: /etc/oaisim/enb |
| 92 | containers: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame^] | 93 | - name: enb |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 94 | image: {{ .Values.images.tags.enb | quote }} |
| 95 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 96 | securityContext: |
| 97 | privileged: true |
| 98 | command: |
| 99 | - /opt/oaisim/enb/scripts/enb-run.sh |
| 100 | - start |
| 101 | lifecycle: |
| 102 | preStop: |
| 103 | exec: |
| 104 | command: |
| 105 | - /opt/oaisim/enb/scripts/enb-run.sh |
| 106 | - stop |
| 107 | env: |
| 108 | - name: ENB_LOCAL_IP |
| 109 | valueFrom: |
| 110 | fieldRef: |
| 111 | fieldPath: status.podIP |
| 112 | volumeMounts: |
| 113 | - name: script |
| 114 | mountPath: /opt/oaisim/enb/scripts/enb-run.sh |
| 115 | subPath: enb-run.sh |
| 116 | - name: pod-share |
| 117 | mountPath: /etc/oaisim/enb |
| 118 | volumes: |
| 119 | - name: config |
| 120 | configMap: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame^] | 121 | name: enb |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 122 | defaultMode: 420 |
| 123 | - name: script |
| 124 | configMap: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame^] | 125 | name: enb |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 126 | defaultMode: 493 |
| 127 | - name: pod-share |
| 128 | emptyDir: {} |