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 |
Scott Baker | acbd36c | 2020-09-29 23:35:08 -0700 | [diff] [blame] | 27 | serviceName: oaisim-enb |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 28 | selector: |
| 29 | matchLabels: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 30 | {{ tuple "enb" . | include "oaisim.metadata_labels" | indent 6 }} |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 31 | template: |
| 32 | metadata: |
| 33 | labels: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 34 | {{ tuple "enb" . | include "oaisim.metadata_labels" | indent 8 }} |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 35 | spec: |
Hyunsun Moon | 43eadcc | 2019-08-20 16:16:08 -0600 | [diff] [blame] | 36 | {{- if .Values.nodeSelectors.enabled }} |
| 37 | nodeSelector: |
| 38 | {{ .Values.nodeSelectors.enb.label }}: {{ .Values.nodeSelectors.enb.value }} |
| 39 | {{- end }} |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 40 | serviceAccountName: enb |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 41 | hostNetwork: true |
| 42 | initContainers: |
| 43 | - name: enb-dep-check |
| 44 | image: {{ .Values.images.tags.dep_check | quote }} |
| 45 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 46 | securityContext: |
| 47 | allowPrivilegeEscalation: false |
| 48 | readOnlyRootFilesystem: false |
| 49 | runAsUser: 0 |
| 50 | env: |
| 51 | - name: POD_NAME |
| 52 | valueFrom: |
| 53 | fieldRef: |
| 54 | apiVersion: v1 |
| 55 | fieldPath: metadata.name |
| 56 | - name: NAMESPACE |
| 57 | valueFrom: |
| 58 | fieldRef: |
| 59 | apiVersion: v1 |
| 60 | fieldPath: metadata.namespace |
| 61 | - name: PATH |
| 62 | value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ |
| 63 | - name: COMMAND |
| 64 | value: "echo done" |
| 65 | - name: DEPENDENCY_POD_JSON |
| 66 | value: '[{"labels": {"app": "mme"}, "requireSameNode": false}]' |
| 67 | command: |
| 68 | - kubernetes-entrypoint |
| 69 | volumeMounts: |
| 70 | [] |
| 71 | - name: enb-init |
| 72 | image: {{ .Values.images.tags.enb | quote }} |
| 73 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 74 | securityContext: |
| 75 | capabilities: |
| 76 | add: |
| 77 | - NET_ADMIN |
| 78 | command: |
| 79 | - /opt/oaisim/enb/scripts/enb-init.sh |
| 80 | env: |
| 81 | - name: ENB_LOCAL_IP |
| 82 | valueFrom: |
| 83 | fieldRef: |
| 84 | fieldPath: status.podIP |
| 85 | volumeMounts: |
| 86 | - name: script |
| 87 | mountPath: /opt/oaisim/enb/scripts/enb-init.sh |
| 88 | subPath: enb-init.sh |
| 89 | - name: config |
| 90 | mountPath: /opt/oaisim/enb/config |
| 91 | - name: pod-share |
| 92 | mountPath: /etc/oaisim/enb |
| 93 | containers: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 94 | - name: enb |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 95 | image: {{ .Values.images.tags.enb | quote }} |
| 96 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 97 | securityContext: |
| 98 | privileged: true |
| 99 | command: |
| 100 | - /opt/oaisim/enb/scripts/enb-run.sh |
| 101 | - start |
| 102 | lifecycle: |
| 103 | preStop: |
| 104 | exec: |
| 105 | command: |
| 106 | - /opt/oaisim/enb/scripts/enb-run.sh |
| 107 | - stop |
| 108 | env: |
| 109 | - name: ENB_LOCAL_IP |
| 110 | valueFrom: |
| 111 | fieldRef: |
| 112 | fieldPath: status.podIP |
| 113 | volumeMounts: |
| 114 | - name: script |
| 115 | mountPath: /opt/oaisim/enb/scripts/enb-run.sh |
| 116 | subPath: enb-run.sh |
| 117 | - name: pod-share |
| 118 | mountPath: /etc/oaisim/enb |
| 119 | volumes: |
| 120 | - name: config |
| 121 | configMap: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 122 | name: enb |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 123 | defaultMode: 420 |
| 124 | - name: script |
| 125 | configMap: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 126 | name: enb |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 127 | defaultMode: 493 |
| 128 | - name: pod-share |
| 129 | emptyDir: {} |