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 "ue" . | 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: ue |
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 "ue" . | 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 "ue" . | 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 "ue" . | 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.ue.label }}: {{ .Values.nodeSelectors.ue.value }} |
| 38 | {{- end }} |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 39 | serviceAccountName: ue |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 40 | hostNetwork: true |
| 41 | initContainers: |
| 42 | - name: ue-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 |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 65 | value: '[{"labels": {"app": "enb"}, "requireSameNode": true}]' |
| 66 | - name: DEPENDENCY_JOBS |
| 67 | value: ue-setup-if |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 68 | command: |
| 69 | - kubernetes-entrypoint |
| 70 | volumeMounts: |
| 71 | [] |
| 72 | - name: ue-gen-usim |
| 73 | image: {{ .Values.images.tags.ue | quote }} |
| 74 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 75 | command: |
| 76 | - /opt/oaisim/ue/scripts/ue-gen-usim.sh |
| 77 | volumeMounts: |
| 78 | - name: script |
| 79 | mountPath: /opt/oaisim/ue/scripts/ue-gen-usim.sh |
| 80 | subPath: ue-gen-usim.sh |
| 81 | - name: config |
| 82 | mountPath: /opt/oaisim/ue/config |
| 83 | - name: pod-share |
| 84 | mountPath: /etc/oaisim/ue |
| 85 | - name: ue-init |
| 86 | image: {{ .Values.images.tags.ue | quote }} |
| 87 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 88 | securityContext: |
| 89 | privileged: true |
| 90 | command: |
| 91 | - /opt/oaisim/ue/scripts/ue-init.sh |
| 92 | volumeMounts: |
| 93 | - name: script |
| 94 | mountPath: /opt/oaisim/ue/scripts/ue-init.sh |
| 95 | subPath: ue-init.sh |
| 96 | containers: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 97 | - name: ue |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 98 | image: {{ .Values.images.tags.ue | quote }} |
| 99 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 100 | securityContext: |
| 101 | privileged: true |
| 102 | command: |
| 103 | - /opt/oaisim/ue/scripts/ue-run.sh |
| 104 | - start |
| 105 | lifecycle: |
| 106 | preStop: |
| 107 | exec: |
| 108 | command: |
| 109 | - /opt/oaisim/enb/scripts/ue-run.sh |
| 110 | - stop |
| 111 | env: |
| 112 | - name: UE_LOCAL_IP |
| 113 | valueFrom: |
| 114 | fieldRef: |
| 115 | fieldPath: status.podIP |
| 116 | volumeMounts: |
| 117 | - name: script |
| 118 | mountPath: /opt/oaisim/ue/scripts/ue-run.sh |
| 119 | subPath: ue-run.sh |
| 120 | - name: config |
| 121 | mountPath: /opt/oaisim/ue/config |
| 122 | - name: pod-share |
| 123 | mountPath: /etc/oaisim/ue |
| 124 | volumes: |
| 125 | - name: config |
| 126 | configMap: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 127 | name: ue |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 128 | defaultMode: 420 |
| 129 | - name: script |
| 130 | configMap: |
Hyunsun Moon | 1015230 | 2019-10-24 20:23:35 -0500 | [diff] [blame] | 131 | name: ue |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 132 | defaultMode: 493 |
| 133 | - name: pod-share |
| 134 | emptyDir: {} |