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