Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 1 | {{/* |
Jeremy Ronquillo | ec2d3e4 | 2020-06-05 11:33:39 -0700 | [diff] [blame] | 2 | # Copyright 2019-present Open Networking Foundation |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 3 | |
Jeremy Ronquillo | 6046ce3 | 2020-06-18 11:06:29 -0700 | [diff] [blame] | 4 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 5 | */}} |
| 6 | |
Hyunsun Moon | 83ff735 | 2020-07-09 11:03:52 -0700 | [diff] [blame] | 7 | {{- if .Values.config.mme.deploy }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 8 | {{ tuple "mme" . | include "omec-control-plane.service_account" }} |
| 9 | --- |
| 10 | apiVersion: apps/v1 |
| 11 | kind: StatefulSet |
| 12 | metadata: |
| 13 | name: mme |
| 14 | labels: |
| 15 | {{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }} |
| 16 | spec: |
| 17 | replicas: 1 |
| 18 | serviceName: mme-headless |
| 19 | selector: |
| 20 | matchLabels: |
| 21 | {{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 6 }} |
| 22 | template: |
| 23 | metadata: |
| 24 | labels: |
| 25 | {{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 8 }} |
| 26 | spec: |
| 27 | {{- if .Values.nodeSelectors.enabled }} |
| 28 | nodeSelector: |
| 29 | {{ .Values.nodeSelectors.mme.label }}: {{ .Values.nodeSelectors.mme.value }} |
| 30 | {{- end }} |
| 31 | serviceAccountName: mme |
| 32 | initContainers: |
| 33 | - name: mme-load-sctp-module |
| 34 | image: {{ .Values.images.tags.init | quote }} |
| 35 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 36 | securityContext: |
| 37 | privileged: true |
| 38 | runAsUser: 0 |
| 39 | command: ["bash", "-xc"] |
| 40 | args: |
| 41 | - | |
| 42 | if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \ |
| 43 | chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \ |
| 44 | fi; |
| 45 | chroot /mnt/host-rootfs modprobe tipc |
| 46 | volumeMounts: |
| 47 | - name: host-rootfs |
| 48 | mountPath: /mnt/host-rootfs |
Hyunsun Moon | 83ff735 | 2020-07-09 11:03:52 -0700 | [diff] [blame] | 49 | {{- if .Values.config.hss.deploy }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 50 | - name: mme-dep-check |
| 51 | image: {{ .Values.images.tags.depCheck | quote }} |
| 52 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 53 | securityContext: |
| 54 | allowPrivilegeEscalation: false |
| 55 | readOnlyRootFilesystem: false |
| 56 | runAsUser: 0 |
| 57 | env: |
| 58 | - name: POD_NAME |
| 59 | valueFrom: |
| 60 | fieldRef: |
| 61 | apiVersion: v1 |
| 62 | fieldPath: metadata.name |
| 63 | - name: NAMESPACE |
| 64 | valueFrom: |
| 65 | fieldRef: |
| 66 | apiVersion: v1 |
| 67 | fieldPath: metadata.namespace |
| 68 | - name: PATH |
| 69 | value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ |
| 70 | - name: COMMAND |
| 71 | value: "echo done" |
| 72 | - name: DEPENDENCY_POD_JSON |
| 73 | value: '[{"labels": {"app": "hss"}, "requireSameNode": false}]' |
| 74 | # add dependency job for make_certs.sh |
| 75 | command: |
| 76 | - kubernetes-entrypoint |
| 77 | volumeMounts: |
| 78 | [] |
Hyunsun Moon | 83ff735 | 2020-07-09 11:03:52 -0700 | [diff] [blame] | 79 | {{- end }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 80 | - name: mme-init |
| 81 | image: {{ .Values.images.tags.mme | quote }} |
| 82 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 83 | command: ["/opt/mme/scripts/mme-init.sh"] |
| 84 | env: |
| 85 | - name: POD_IP |
| 86 | valueFrom: |
| 87 | fieldRef: |
| 88 | fieldPath: status.podIP |
| 89 | volumeMounts: |
| 90 | - name: scripts |
| 91 | mountPath: /opt/mme/scripts/mme-init.sh |
| 92 | subPath: mme-init.sh |
| 93 | - name: configs |
| 94 | mountPath: /opt/mme/config |
| 95 | - name: shared-data |
| 96 | mountPath: /opt/mme/config/shared |
| 97 | {{- if .Values.config.coreDump.enabled }} |
| 98 | {{ tuple "mme" . | include "omec-control-plane.coredump_init" | indent 6 }} |
| 99 | {{- end }} |
| 100 | containers: |
| 101 | - name: mme-app |
| 102 | image: {{ .Values.images.tags.mme | quote }} |
| 103 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 104 | {{- if .Values.config.coreDump.enabled }} |
| 105 | securityContext: |
| 106 | privileged: true |
| 107 | runAsUser: 0 |
| 108 | {{- end }} |
| 109 | command: ["bash", "-xc"] |
| 110 | args: |
| 111 | - /opt/mme/scripts/mme-run.sh mme-app |
| 112 | {{- if .Values.resources.enabled }} |
| 113 | resources: |
| 114 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 115 | {{- end }} |
| 116 | env: |
| 117 | - name: POD_IP |
| 118 | valueFrom: |
| 119 | fieldRef: |
| 120 | fieldPath: status.podIP |
| 121 | - name: MMERUNENV |
| 122 | value: "container" |
| 123 | volumeMounts: |
| 124 | - name: scripts |
| 125 | mountPath: /opt/mme/scripts/mme-run.sh |
| 126 | subPath: mme-run.sh |
| 127 | - name: shared-data |
| 128 | mountPath: /opt/mme/config/shared |
| 129 | - name: shared-app |
| 130 | mountPath: /tmp |
| 131 | - name: configs |
| 132 | mountPath: /opt/mme/config |
| 133 | {{- if .Values.config.coreDump.enabled }} |
| 134 | - name: coredump |
| 135 | mountPath: /tmp/coredump |
| 136 | {{- end }} |
| 137 | - name: s1ap-app |
| 138 | image: {{ .Values.images.tags.mme | quote }} |
| 139 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 140 | {{- if .Values.config.coreDump.enabled }} |
| 141 | securityContext: |
| 142 | privileged: true |
| 143 | runAsUser: 0 |
| 144 | {{- end }} |
| 145 | command: ["bash", "-xc"] |
| 146 | args: |
| 147 | - /opt/mme/scripts/mme-run.sh s1ap-app |
| 148 | {{- if .Values.resources.enabled }} |
| 149 | resources: |
| 150 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 151 | {{- end }} |
| 152 | env: |
| 153 | - name: MMERUNENV |
| 154 | value: "container" |
| 155 | volumeMounts: |
| 156 | - name: scripts |
| 157 | mountPath: /opt/mme/scripts/mme-run.sh |
| 158 | subPath: mme-run.sh |
| 159 | - name: shared-data |
| 160 | mountPath: /opt/mme/config/shared |
| 161 | - name: shared-app |
| 162 | mountPath: /tmp |
| 163 | - name: configs |
| 164 | mountPath: /opt/mme/config |
| 165 | {{- if .Values.config.coreDump.enabled }} |
| 166 | - name: coredump |
| 167 | mountPath: /tmp/coredump |
| 168 | {{- end }} |
| 169 | - name: s6a-app |
| 170 | image: {{ .Values.images.tags.mme | quote }} |
| 171 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 172 | {{- if .Values.config.coreDump.enabled }} |
| 173 | securityContext: |
| 174 | privileged: true |
| 175 | runAsUser: 0 |
| 176 | {{- end }} |
| 177 | command: ["bash", "-xc"] |
| 178 | args: |
| 179 | - /opt/mme/scripts/mme-run.sh s6a-app |
| 180 | {{- if .Values.resources.enabled }} |
| 181 | resources: |
| 182 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 183 | {{- end }} |
| 184 | env: |
| 185 | - name: MMERUNENV |
| 186 | value: "container" |
| 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 | {{- if .Values.config.coreDump.enabled }} |
| 196 | - name: coredump |
| 197 | mountPath: /tmp/coredump |
| 198 | {{- end }} |
| 199 | - name: s11-app |
| 200 | image: {{ .Values.images.tags.mme | quote }} |
| 201 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 202 | {{- if .Values.config.coreDump.enabled }} |
| 203 | securityContext: |
| 204 | privileged: true |
| 205 | runAsUser: 0 |
| 206 | {{- end }} |
| 207 | command: ["bash", "-xc"] |
| 208 | args: |
| 209 | - /opt/mme/scripts/mme-run.sh s11-app |
| 210 | {{- if .Values.resources.enabled }} |
| 211 | resources: |
| 212 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 213 | {{- end }} |
| 214 | env: |
| 215 | - name: MMERUNENV |
| 216 | value: "container" |
| 217 | volumeMounts: |
| 218 | - name: scripts |
| 219 | mountPath: /opt/mme/scripts/mme-run.sh |
| 220 | subPath: mme-run.sh |
| 221 | - name: shared-data |
| 222 | mountPath: /opt/mme/config/shared |
| 223 | - name: shared-app |
| 224 | mountPath: /tmp |
| 225 | {{- if .Values.config.coreDump.enabled }} |
| 226 | - name: coredump |
| 227 | mountPath: /tmp/coredump |
| 228 | {{- end }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 229 | volumes: |
| 230 | - name: scripts |
| 231 | configMap: |
| 232 | name: mme |
| 233 | defaultMode: 493 |
| 234 | - name: configs |
| 235 | configMap: |
| 236 | name: mme |
| 237 | defaultMode: 420 |
| 238 | - name: shared-data |
| 239 | emptyDir: {} |
| 240 | - name: shared-app |
| 241 | emptyDir: {} |
| 242 | - name: host-rootfs |
| 243 | hostPath: |
| 244 | path: / |
| 245 | {{- if .Values.config.coreDump.enabled }} |
| 246 | - name: coredump |
| 247 | hostPath: |
| 248 | path: {{ .Values.config.coreDump.path }} |
| 249 | {{- end }} |
Hyunsun Moon | 83ff735 | 2020-07-09 11:03:52 -0700 | [diff] [blame] | 250 | {{- end }} |