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 |
Hyunsun Moon | b0c8bcc | 2021-09-09 09:33:26 -0700 | [diff] [blame] | 47 | command: ["sh", "-xc"] |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 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" |
Ajay Lotan Thakur | 418dd5a | 2021-08-14 00:43:14 -0500 | [diff] [blame] | 130 | {{- if .Values.config.managedByConfigPod.enabled }} |
| 131 | - name: MANAGED_BY_CONFIG_POD |
| 132 | value: "true" |
| 133 | {{- end }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 134 | volumeMounts: |
| 135 | - name: scripts |
Hyunsun Moon | 1fc2447 | 2021-03-14 19:10:11 -0500 | [diff] [blame] | 136 | mountPath: /opt/mme/scripts |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 137 | - name: shared-data |
| 138 | mountPath: /opt/mme/config/shared |
| 139 | - name: shared-app |
| 140 | mountPath: /tmp |
| 141 | - name: configs |
| 142 | mountPath: /opt/mme/config |
| 143 | {{- if .Values.config.coreDump.enabled }} |
| 144 | - name: coredump |
| 145 | mountPath: /tmp/coredump |
| 146 | {{- end }} |
| 147 | - name: s1ap-app |
| 148 | image: {{ .Values.images.tags.mme | quote }} |
| 149 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 150 | {{- if .Values.config.coreDump.enabled }} |
| 151 | securityContext: |
| 152 | privileged: true |
| 153 | runAsUser: 0 |
| 154 | {{- end }} |
| 155 | command: ["bash", "-xc"] |
| 156 | args: |
| 157 | - /opt/mme/scripts/mme-run.sh s1ap-app |
| 158 | {{- if .Values.resources.enabled }} |
| 159 | resources: |
| 160 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 161 | {{- end }} |
| 162 | env: |
| 163 | - name: MMERUNENV |
| 164 | value: "container" |
Ajay Lotan Thakur | 418dd5a | 2021-08-14 00:43:14 -0500 | [diff] [blame] | 165 | {{- if .Values.config.managedByConfigPod.enabled }} |
| 166 | - name: MANAGED_BY_CONFIG_POD |
| 167 | value: "true" |
| 168 | {{- end }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 169 | volumeMounts: |
| 170 | - name: scripts |
Hyunsun Moon | 1fc2447 | 2021-03-14 19:10:11 -0500 | [diff] [blame] | 171 | mountPath: /opt/mme/scripts |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 172 | - name: shared-data |
| 173 | mountPath: /opt/mme/config/shared |
| 174 | - name: shared-app |
| 175 | mountPath: /tmp |
| 176 | - name: configs |
| 177 | mountPath: /opt/mme/config |
| 178 | {{- if .Values.config.coreDump.enabled }} |
| 179 | - name: coredump |
| 180 | mountPath: /tmp/coredump |
| 181 | {{- end }} |
| 182 | - name: s6a-app |
| 183 | image: {{ .Values.images.tags.mme | quote }} |
| 184 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 185 | {{- if .Values.config.coreDump.enabled }} |
| 186 | securityContext: |
| 187 | privileged: true |
| 188 | runAsUser: 0 |
| 189 | {{- end }} |
| 190 | command: ["bash", "-xc"] |
| 191 | args: |
| 192 | - /opt/mme/scripts/mme-run.sh s6a-app |
| 193 | {{- if .Values.resources.enabled }} |
| 194 | resources: |
| 195 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 196 | {{- end }} |
| 197 | env: |
| 198 | - name: MMERUNENV |
| 199 | value: "container" |
Ajay Lotan Thakur | 418dd5a | 2021-08-14 00:43:14 -0500 | [diff] [blame] | 200 | {{- if .Values.config.managedByConfigPod.enabled }} |
| 201 | - name: MANAGED_BY_CONFIG_POD |
| 202 | value: "true" |
| 203 | {{- end }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 204 | volumeMounts: |
| 205 | - name: scripts |
Hyunsun Moon | 1fc2447 | 2021-03-14 19:10:11 -0500 | [diff] [blame] | 206 | mountPath: /opt/mme/scripts |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 207 | - name: shared-data |
| 208 | mountPath: /opt/mme/config/shared |
| 209 | - name: shared-app |
| 210 | mountPath: /tmp |
| 211 | {{- if .Values.config.coreDump.enabled }} |
| 212 | - name: coredump |
| 213 | mountPath: /tmp/coredump |
| 214 | {{- end }} |
| 215 | - name: s11-app |
| 216 | image: {{ .Values.images.tags.mme | quote }} |
| 217 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 218 | {{- if .Values.config.coreDump.enabled }} |
| 219 | securityContext: |
| 220 | privileged: true |
| 221 | runAsUser: 0 |
| 222 | {{- end }} |
| 223 | command: ["bash", "-xc"] |
| 224 | args: |
| 225 | - /opt/mme/scripts/mme-run.sh s11-app |
| 226 | {{- if .Values.resources.enabled }} |
| 227 | resources: |
| 228 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 229 | {{- end }} |
| 230 | env: |
| 231 | - name: MMERUNENV |
| 232 | value: "container" |
Ajay Lotan Thakur | 418dd5a | 2021-08-14 00:43:14 -0500 | [diff] [blame] | 233 | {{- if .Values.config.managedByConfigPod.enabled }} |
| 234 | - name: MANAGED_BY_CONFIG_POD |
| 235 | value: "true" |
| 236 | {{- end }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 237 | volumeMounts: |
| 238 | - name: scripts |
Hyunsun Moon | 1fc2447 | 2021-03-14 19:10:11 -0500 | [diff] [blame] | 239 | mountPath: /opt/mme/scripts |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 240 | - name: shared-data |
| 241 | mountPath: /opt/mme/config/shared |
| 242 | - name: shared-app |
| 243 | mountPath: /tmp |
| 244 | {{- if .Values.config.coreDump.enabled }} |
| 245 | - name: coredump |
| 246 | mountPath: /tmp/coredump |
| 247 | {{- end }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 248 | volumes: |
| 249 | - name: scripts |
| 250 | configMap: |
Hyunsun Moon | 1fc2447 | 2021-03-14 19:10:11 -0500 | [diff] [blame] | 251 | name: mme-scripts |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 252 | defaultMode: 493 |
| 253 | - name: configs |
| 254 | configMap: |
Hyunsun Moon | 1fc2447 | 2021-03-14 19:10:11 -0500 | [diff] [blame] | 255 | name: mme-configs |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 256 | defaultMode: 420 |
| 257 | - name: shared-data |
| 258 | emptyDir: {} |
| 259 | - name: shared-app |
| 260 | emptyDir: {} |
| 261 | - name: host-rootfs |
| 262 | hostPath: |
| 263 | path: / |
| 264 | {{- if .Values.config.coreDump.enabled }} |
| 265 | - name: coredump |
| 266 | hostPath: |
| 267 | path: {{ .Values.config.coreDump.path }} |
| 268 | {{- end }} |
Hyunsun Moon | 83ff735 | 2020-07-09 11:03:52 -0700 | [diff] [blame] | 269 | {{- end }} |