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