Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 1 | {{/* |
| 2 | Copyright 2019-present Open Networking Foundation |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 3 | |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 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 |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 7 | |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 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 | 16d7092 | 2019-08-25 04:57:25 -0500 | [diff] [blame] | 17 | {{ tuple "mme" . | include "omec-control-plane.service_account" }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 18 | --- |
| 19 | apiVersion: apps/v1 |
| 20 | kind: StatefulSet |
| 21 | metadata: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 22 | name: mme |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 23 | labels: |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 24 | {{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 25 | spec: |
| 26 | replicas: 1 |
| 27 | selector: |
| 28 | matchLabels: |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 29 | {{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 6 }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 30 | template: |
| 31 | metadata: |
| 32 | labels: |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 33 | {{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 8 }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 34 | spec: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 35 | {{- if .Values.nodeSelectors.enabled }} |
| 36 | nodeSelector: |
| 37 | {{ .Values.nodeSelectors.mme.label }}: {{ .Values.nodeSelectors.mme.value }} |
| 38 | {{- end }} |
| 39 | serviceAccountName: mme |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 40 | initContainers: |
Hyunsun Moon | 16d7092 | 2019-08-25 04:57:25 -0500 | [diff] [blame] | 41 | {{- if not (hasKey .Values.config.spgwc "mmeAddr") }} |
| 42 | - name: mme-configmap-mme-ip |
| 43 | image: {{ .Values.images.tags.init | quote }} |
| 44 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 45 | env: |
| 46 | - name: NAMESPACE |
| 47 | valueFrom: |
| 48 | fieldRef: |
| 49 | apiVersion: v1 |
| 50 | fieldPath: metadata.namespace |
| 51 | - name: POD_IP |
| 52 | valueFrom: |
| 53 | fieldRef: |
| 54 | fieldPath: status.podIP |
| 55 | command: ["/opt/mme/scripts/mme-ip.sh"] |
| 56 | volumeMounts: |
| 57 | - name: scripts |
| 58 | mountPath: /opt/mme/scripts/mme-ip.sh |
| 59 | subPath: mme-ip.sh |
| 60 | {{- end }} |
Hyunsun Moon | ece8698 | 2019-09-27 17:44:59 -0500 | [diff] [blame] | 61 | - name: mme-load-sctp-module |
| 62 | image: {{ .Values.images.tags.init | quote }} |
| 63 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 64 | securityContext: |
| 65 | privileged: true |
| 66 | runAsUser: 0 |
| 67 | command: ["bash", "-xc"] |
| 68 | args: |
| 69 | - > |
| 70 | if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \ |
| 71 | chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \ |
| 72 | fi |
| 73 | volumeMounts: |
| 74 | - name: host-rootfs |
| 75 | mountPath: /mnt/host-rootfs |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 76 | - name: mme-dep-check |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 77 | image: {{ .Values.images.tags.depCheck | quote }} |
| 78 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 79 | securityContext: |
| 80 | allowPrivilegeEscalation: false |
| 81 | readOnlyRootFilesystem: false |
| 82 | runAsUser: 0 |
| 83 | env: |
| 84 | - name: POD_NAME |
| 85 | valueFrom: |
| 86 | fieldRef: |
| 87 | apiVersion: v1 |
| 88 | fieldPath: metadata.name |
| 89 | - name: NAMESPACE |
| 90 | valueFrom: |
| 91 | fieldRef: |
| 92 | apiVersion: v1 |
| 93 | fieldPath: metadata.namespace |
| 94 | - name: PATH |
| 95 | value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ |
| 96 | - name: COMMAND |
| 97 | value: "echo done" |
| 98 | - name: DEPENDENCY_POD_JSON |
Hyunsun Moon | 16d7092 | 2019-08-25 04:57:25 -0500 | [diff] [blame] | 99 | value: '[{"labels": {"app": "hss"}, "requireSameNode": false}]' |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 100 | # add dependency job for make_certs.sh |
| 101 | command: |
| 102 | - kubernetes-entrypoint |
| 103 | volumeMounts: |
| 104 | [] |
| 105 | - name: mme-init |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 106 | image: {{ .Values.images.tags.mme | quote }} |
| 107 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 108 | command: ["/opt/mme/scripts/mme-init.sh"] |
| 109 | env: |
Hyunsun Moon | 16d7092 | 2019-08-25 04:57:25 -0500 | [diff] [blame] | 110 | - name: POD_IP |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 111 | valueFrom: |
| 112 | fieldRef: |
| 113 | fieldPath: status.podIP |
| 114 | volumeMounts: |
| 115 | - name: scripts |
| 116 | mountPath: /opt/mme/scripts/mme-init.sh |
| 117 | subPath: mme-init.sh |
| 118 | - name: configs |
| 119 | mountPath: /opt/mme/config |
| 120 | - name: shared-data |
| 121 | mountPath: /opt/mme/config/shared |
| 122 | containers: |
| 123 | - name: mme-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 124 | image: {{ .Values.images.tags.mme | quote }} |
| 125 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 126 | command: ["bash", "-xc"] |
| 127 | args: |
| 128 | - /opt/mme/scripts/mme-run.sh mme-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 129 | {{- if .Values.resources.enabled }} |
| 130 | resources: |
| 131 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 132 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 133 | volumeMounts: |
| 134 | - name: scripts |
| 135 | mountPath: /opt/mme/scripts/mme-run.sh |
| 136 | subPath: mme-run.sh |
| 137 | - name: shared-data |
| 138 | mountPath: /opt/mme/config/shared |
| 139 | - name: shared-app |
| 140 | mountPath: /tmp |
| 141 | - name: s1ap-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 142 | image: {{ .Values.images.tags.mme | quote }} |
| 143 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 144 | command: ["bash", "-xc"] |
| 145 | args: |
| 146 | - /opt/mme/scripts/mme-run.sh s1ap-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 147 | {{- if .Values.resources.enabled }} |
| 148 | resources: |
| 149 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 150 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 151 | volumeMounts: |
| 152 | - name: scripts |
| 153 | mountPath: /opt/mme/scripts/mme-run.sh |
| 154 | subPath: mme-run.sh |
| 155 | - name: shared-data |
| 156 | mountPath: /opt/mme/config/shared |
| 157 | - name: shared-app |
| 158 | mountPath: /tmp |
| 159 | - name: s6a-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 160 | image: {{ .Values.images.tags.mme | quote }} |
| 161 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 162 | command: ["bash", "-xc"] |
| 163 | args: |
| 164 | - /opt/mme/scripts/mme-run.sh s6a-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 165 | {{- if .Values.resources.enabled }} |
| 166 | resources: |
| 167 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 168 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 169 | volumeMounts: |
| 170 | - name: scripts |
| 171 | mountPath: /opt/mme/scripts/mme-run.sh |
| 172 | subPath: mme-run.sh |
| 173 | - name: shared-data |
| 174 | mountPath: /opt/mme/config/shared |
| 175 | - name: shared-app |
| 176 | mountPath: /tmp |
| 177 | - name: s11-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 178 | image: {{ .Values.images.tags.mme | quote }} |
| 179 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 180 | command: ["bash", "-xc"] |
| 181 | args: |
| 182 | - /opt/mme/scripts/mme-run.sh s11-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 183 | {{- if .Values.resources.enabled }} |
| 184 | resources: |
| 185 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 186 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 187 | volumeMounts: |
| 188 | - name: scripts |
| 189 | mountPath: /opt/mme/scripts/mme-run.sh |
| 190 | subPath: mme-run.sh |
| 191 | - name: shared-data |
| 192 | mountPath: /opt/mme/config/shared |
| 193 | - name: shared-app |
| 194 | mountPath: /tmp |
| 195 | volumes: |
| 196 | - name: scripts |
| 197 | configMap: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 198 | name: mme |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 199 | defaultMode: 493 |
| 200 | - name: configs |
| 201 | configMap: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 202 | name: mme |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 203 | defaultMode: 420 |
| 204 | - name: shared-data |
| 205 | emptyDir: {} |
| 206 | - name: shared-app |
| 207 | emptyDir: {} |
Hyunsun Moon | ece8698 | 2019-09-27 17:44:59 -0500 | [diff] [blame] | 208 | - name: host-rootfs |
| 209 | hostPath: |
| 210 | path: / |