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 |
Hyunsun Moon | 834c28f | 2019-12-05 18:26:22 -0800 | [diff] [blame] | 27 | serviceName: mme-headless |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 28 | selector: |
| 29 | matchLabels: |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 30 | {{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 6 }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 31 | template: |
| 32 | metadata: |
| 33 | labels: |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 34 | {{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 8 }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 35 | spec: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 36 | {{- if .Values.nodeSelectors.enabled }} |
| 37 | nodeSelector: |
| 38 | {{ .Values.nodeSelectors.mme.label }}: {{ .Values.nodeSelectors.mme.value }} |
| 39 | {{- end }} |
| 40 | serviceAccountName: mme |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 41 | initContainers: |
Hyunsun Moon | ece8698 | 2019-09-27 17:44:59 -0500 | [diff] [blame] | 42 | - name: mme-load-sctp-module |
| 43 | image: {{ .Values.images.tags.init | quote }} |
| 44 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 45 | securityContext: |
| 46 | privileged: true |
| 47 | runAsUser: 0 |
| 48 | command: ["bash", "-xc"] |
| 49 | args: |
Ajay Lotan Thakur | 8418c17 | 2020-04-23 16:30:43 +0000 | [diff] [blame] | 50 | - | |
Hyunsun Moon | ece8698 | 2019-09-27 17:44:59 -0500 | [diff] [blame] | 51 | if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \ |
| 52 | chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \ |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 53 | fi; |
Ajay Lotan Thakur | 8418c17 | 2020-04-23 16:30:43 +0000 | [diff] [blame] | 54 | chroot /mnt/host-rootfs modprobe tipc |
Hyunsun Moon | ece8698 | 2019-09-27 17:44:59 -0500 | [diff] [blame] | 55 | volumeMounts: |
| 56 | - name: host-rootfs |
| 57 | mountPath: /mnt/host-rootfs |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 58 | - name: mme-dep-check |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 59 | image: {{ .Values.images.tags.depCheck | quote }} |
| 60 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 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 |
Hyunsun Moon | 16d7092 | 2019-08-25 04:57:25 -0500 | [diff] [blame] | 81 | value: '[{"labels": {"app": "hss"}, "requireSameNode": false}]' |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 82 | # add dependency job for make_certs.sh |
| 83 | command: |
| 84 | - kubernetes-entrypoint |
| 85 | volumeMounts: |
| 86 | [] |
| 87 | - name: mme-init |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 88 | image: {{ .Values.images.tags.mme | quote }} |
| 89 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 90 | command: ["/opt/mme/scripts/mme-init.sh"] |
| 91 | env: |
Hyunsun Moon | 16d7092 | 2019-08-25 04:57:25 -0500 | [diff] [blame] | 92 | - name: POD_IP |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 93 | valueFrom: |
| 94 | fieldRef: |
| 95 | fieldPath: status.podIP |
| 96 | volumeMounts: |
| 97 | - name: scripts |
| 98 | mountPath: /opt/mme/scripts/mme-init.sh |
| 99 | subPath: mme-init.sh |
| 100 | - name: configs |
| 101 | mountPath: /opt/mme/config |
| 102 | - name: shared-data |
| 103 | mountPath: /opt/mme/config/shared |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 104 | {{- if .Values.config.coreDump.enabled }} |
| 105 | {{ tuple "mme" . | include "omec-control-plane.coredump_init" | indent 6 }} |
| 106 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 107 | containers: |
| 108 | - name: mme-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 109 | image: {{ .Values.images.tags.mme | quote }} |
| 110 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 111 | {{- if .Values.config.coreDump.enabled }} |
| 112 | securityContext: |
| 113 | privileged: true |
| 114 | runAsUser: 0 |
| 115 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 116 | command: ["bash", "-xc"] |
| 117 | args: |
| 118 | - /opt/mme/scripts/mme-run.sh mme-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 119 | {{- if .Values.resources.enabled }} |
| 120 | resources: |
| 121 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 122 | {{- end }} |
Ajay Lotan Thakur | 0e134ec | 2020-04-02 12:31:53 -0600 | [diff] [blame] | 123 | env: |
| 124 | - name: POD_IP |
| 125 | valueFrom: |
| 126 | fieldRef: |
| 127 | fieldPath: status.podIP |
Ajay Lotan Thakur | 8418c17 | 2020-04-23 16:30:43 +0000 | [diff] [blame] | 128 | - name: MMERUNENV |
| 129 | value: "container" |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 130 | volumeMounts: |
| 131 | - name: scripts |
| 132 | mountPath: /opt/mme/scripts/mme-run.sh |
| 133 | subPath: mme-run.sh |
| 134 | - name: shared-data |
| 135 | mountPath: /opt/mme/config/shared |
| 136 | - name: shared-app |
| 137 | mountPath: /tmp |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 138 | - name: configs |
| 139 | mountPath: /opt/mme/config |
| 140 | {{- if .Values.config.coreDump.enabled }} |
| 141 | - name: coredump |
| 142 | mountPath: /tmp/coredump |
| 143 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 144 | - name: s1ap-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 145 | image: {{ .Values.images.tags.mme | quote }} |
| 146 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 147 | {{- if .Values.config.coreDump.enabled }} |
| 148 | securityContext: |
| 149 | privileged: true |
| 150 | runAsUser: 0 |
| 151 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 152 | command: ["bash", "-xc"] |
| 153 | args: |
| 154 | - /opt/mme/scripts/mme-run.sh s1ap-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 155 | {{- if .Values.resources.enabled }} |
| 156 | resources: |
| 157 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 158 | {{- end }} |
Ajay Lotan Thakur | 8418c17 | 2020-04-23 16:30:43 +0000 | [diff] [blame] | 159 | env: |
| 160 | - name: MMERUNENV |
| 161 | value: "container" |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 162 | volumeMounts: |
| 163 | - name: scripts |
| 164 | mountPath: /opt/mme/scripts/mme-run.sh |
| 165 | subPath: mme-run.sh |
| 166 | - name: shared-data |
| 167 | mountPath: /opt/mme/config/shared |
| 168 | - name: shared-app |
| 169 | mountPath: /tmp |
Ajay Lotan Thakur | 0e134ec | 2020-04-02 12:31:53 -0600 | [diff] [blame] | 170 | - name: configs |
| 171 | mountPath: /opt/mme/config |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 172 | {{- if .Values.config.coreDump.enabled }} |
| 173 | - name: coredump |
| 174 | mountPath: /tmp/coredump |
| 175 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 176 | - name: s6a-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 177 | image: {{ .Values.images.tags.mme | quote }} |
| 178 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 179 | {{- if .Values.config.coreDump.enabled }} |
| 180 | securityContext: |
| 181 | privileged: true |
| 182 | runAsUser: 0 |
| 183 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 184 | command: ["bash", "-xc"] |
| 185 | args: |
| 186 | - /opt/mme/scripts/mme-run.sh s6a-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 187 | {{- if .Values.resources.enabled }} |
| 188 | resources: |
| 189 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 190 | {{- end }} |
Ajay Lotan Thakur | 8418c17 | 2020-04-23 16:30:43 +0000 | [diff] [blame] | 191 | env: |
| 192 | - name: MMERUNENV |
| 193 | value: "container" |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 194 | volumeMounts: |
| 195 | - name: scripts |
| 196 | mountPath: /opt/mme/scripts/mme-run.sh |
| 197 | subPath: mme-run.sh |
| 198 | - name: shared-data |
| 199 | mountPath: /opt/mme/config/shared |
| 200 | - name: shared-app |
| 201 | mountPath: /tmp |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 202 | {{- if .Values.config.coreDump.enabled }} |
| 203 | - name: coredump |
| 204 | mountPath: /tmp/coredump |
| 205 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 206 | - name: s11-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 207 | image: {{ .Values.images.tags.mme | quote }} |
| 208 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 209 | {{- if .Values.config.coreDump.enabled }} |
| 210 | securityContext: |
| 211 | privileged: true |
| 212 | runAsUser: 0 |
| 213 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 214 | command: ["bash", "-xc"] |
| 215 | args: |
| 216 | - /opt/mme/scripts/mme-run.sh s11-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 217 | {{- if .Values.resources.enabled }} |
| 218 | resources: |
| 219 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 220 | {{- end }} |
Ajay Lotan Thakur | 8418c17 | 2020-04-23 16:30:43 +0000 | [diff] [blame] | 221 | env: |
| 222 | - name: MMERUNENV |
| 223 | value: "container" |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 224 | volumeMounts: |
| 225 | - name: scripts |
| 226 | mountPath: /opt/mme/scripts/mme-run.sh |
| 227 | subPath: mme-run.sh |
| 228 | - name: shared-data |
| 229 | mountPath: /opt/mme/config/shared |
| 230 | - name: shared-app |
| 231 | mountPath: /tmp |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 232 | {{- if .Values.config.coreDump.enabled }} |
| 233 | - name: coredump |
| 234 | mountPath: /tmp/coredump |
| 235 | {{- end }} |
Woojoong Kim | f6ba870 | 2020-01-24 12:49:05 -0800 | [diff] [blame] | 236 | {{- if .Values.prometheusExporter.mme.enabled }} |
| 237 | - name: subscriber-exporter |
| 238 | image: {{ .Values.images.tags.mmeExporter }} |
| 239 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 240 | securityContext: |
| 241 | privileged: true |
| 242 | command: ["bash", "-xc"] |
| 243 | args: |
Woojoong Kim | dde90e3 | 2020-02-18 14:43:18 -0800 | [diff] [blame] | 244 | - cp /opt/mme/config/shared/mme_exporter.json /openmme/conf/mme_exporter.json; |
| 245 | until [ -e /tmp/unix_socket ]; do sleep 1; done; |
| 246 | chmod 777 /tmp/unix_socket; |
| 247 | while true; do python3 monitor_client.py; sleep 1; done; |
Woojoong Kim | f6ba870 | 2020-01-24 12:49:05 -0800 | [diff] [blame] | 248 | {{- if .Values.resources.enabled }} |
| 249 | resources: |
| 250 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 251 | {{- end }} |
| 252 | volumeMounts: |
Woojoong Kim | dde90e3 | 2020-02-18 14:43:18 -0800 | [diff] [blame] | 253 | - name: shared-data |
| 254 | mountPath: /opt/mme/config/shared |
Woojoong Kim | f6ba870 | 2020-01-24 12:49:05 -0800 | [diff] [blame] | 255 | - name: shared-app |
| 256 | mountPath: /tmp |
| 257 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 258 | volumes: |
| 259 | - name: scripts |
| 260 | configMap: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 261 | name: mme |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 262 | defaultMode: 493 |
| 263 | - name: configs |
| 264 | configMap: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 265 | name: mme |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 266 | defaultMode: 420 |
| 267 | - name: shared-data |
| 268 | emptyDir: {} |
| 269 | - name: shared-app |
| 270 | emptyDir: {} |
Hyunsun Moon | ece8698 | 2019-09-27 17:44:59 -0500 | [diff] [blame] | 271 | - name: host-rootfs |
| 272 | hostPath: |
| 273 | path: / |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 274 | {{- if .Values.config.coreDump.enabled }} |
| 275 | - name: coredump |
| 276 | hostPath: |
| 277 | path: {{ .Values.config.coreDump.path }} |
| 278 | {{- end }} |