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: |
| 50 | - > |
| 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; |
Hyunsun Moon | ece8698 | 2019-09-27 17:44:59 -0500 | [diff] [blame] | 54 | volumeMounts: |
| 55 | - name: host-rootfs |
| 56 | mountPath: /mnt/host-rootfs |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 57 | - name: mme-dep-check |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 58 | image: {{ .Values.images.tags.depCheck | quote }} |
| 59 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 60 | securityContext: |
| 61 | allowPrivilegeEscalation: false |
| 62 | readOnlyRootFilesystem: false |
| 63 | runAsUser: 0 |
| 64 | env: |
| 65 | - name: POD_NAME |
| 66 | valueFrom: |
| 67 | fieldRef: |
| 68 | apiVersion: v1 |
| 69 | fieldPath: metadata.name |
| 70 | - name: NAMESPACE |
| 71 | valueFrom: |
| 72 | fieldRef: |
| 73 | apiVersion: v1 |
| 74 | fieldPath: metadata.namespace |
| 75 | - name: PATH |
| 76 | value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ |
| 77 | - name: COMMAND |
| 78 | value: "echo done" |
| 79 | - name: DEPENDENCY_POD_JSON |
Hyunsun Moon | 16d7092 | 2019-08-25 04:57:25 -0500 | [diff] [blame] | 80 | value: '[{"labels": {"app": "hss"}, "requireSameNode": false}]' |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 81 | # add dependency job for make_certs.sh |
| 82 | command: |
| 83 | - kubernetes-entrypoint |
| 84 | volumeMounts: |
| 85 | [] |
| 86 | - name: mme-init |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 87 | image: {{ .Values.images.tags.mme | quote }} |
| 88 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 89 | command: ["/opt/mme/scripts/mme-init.sh"] |
| 90 | env: |
Hyunsun Moon | 16d7092 | 2019-08-25 04:57:25 -0500 | [diff] [blame] | 91 | - name: POD_IP |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 92 | valueFrom: |
| 93 | fieldRef: |
| 94 | fieldPath: status.podIP |
| 95 | volumeMounts: |
| 96 | - name: scripts |
| 97 | mountPath: /opt/mme/scripts/mme-init.sh |
| 98 | subPath: mme-init.sh |
| 99 | - name: configs |
| 100 | mountPath: /opt/mme/config |
| 101 | - name: shared-data |
| 102 | mountPath: /opt/mme/config/shared |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 103 | {{- if .Values.config.coreDump.enabled }} |
| 104 | {{ tuple "mme" . | include "omec-control-plane.coredump_init" | indent 6 }} |
| 105 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 106 | containers: |
| 107 | - name: mme-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 108 | image: {{ .Values.images.tags.mme | quote }} |
| 109 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 110 | {{- if .Values.config.coreDump.enabled }} |
| 111 | securityContext: |
| 112 | privileged: true |
| 113 | runAsUser: 0 |
| 114 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 115 | command: ["bash", "-xc"] |
| 116 | args: |
| 117 | - /opt/mme/scripts/mme-run.sh mme-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 118 | {{- if .Values.resources.enabled }} |
| 119 | resources: |
| 120 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 121 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 122 | volumeMounts: |
| 123 | - name: scripts |
| 124 | mountPath: /opt/mme/scripts/mme-run.sh |
| 125 | subPath: mme-run.sh |
| 126 | - name: shared-data |
| 127 | mountPath: /opt/mme/config/shared |
| 128 | - name: shared-app |
| 129 | mountPath: /tmp |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 130 | - name: configs |
| 131 | mountPath: /opt/mme/config |
| 132 | {{- if .Values.config.coreDump.enabled }} |
| 133 | - name: coredump |
| 134 | mountPath: /tmp/coredump |
| 135 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 136 | - name: s1ap-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 137 | image: {{ .Values.images.tags.mme | quote }} |
| 138 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 139 | {{- if .Values.config.coreDump.enabled }} |
| 140 | securityContext: |
| 141 | privileged: true |
| 142 | runAsUser: 0 |
| 143 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 144 | command: ["bash", "-xc"] |
| 145 | args: |
| 146 | - /opt/mme/scripts/mme-run.sh s1ap-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 147 | {{- if .Values.resources.enabled }} |
| 148 | resources: |
| 149 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 150 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 151 | volumeMounts: |
| 152 | - name: scripts |
| 153 | mountPath: /opt/mme/scripts/mme-run.sh |
| 154 | subPath: mme-run.sh |
| 155 | - name: shared-data |
| 156 | mountPath: /opt/mme/config/shared |
| 157 | - name: shared-app |
| 158 | mountPath: /tmp |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 159 | {{- if .Values.config.coreDump.enabled }} |
| 160 | - name: coredump |
| 161 | mountPath: /tmp/coredump |
| 162 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 163 | - name: s6a-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 164 | image: {{ .Values.images.tags.mme | quote }} |
| 165 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 166 | {{- if .Values.config.coreDump.enabled }} |
| 167 | securityContext: |
| 168 | privileged: true |
| 169 | runAsUser: 0 |
| 170 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 171 | command: ["bash", "-xc"] |
| 172 | args: |
| 173 | - /opt/mme/scripts/mme-run.sh s6a-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 174 | {{- if .Values.resources.enabled }} |
| 175 | resources: |
| 176 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 177 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 178 | volumeMounts: |
| 179 | - name: scripts |
| 180 | mountPath: /opt/mme/scripts/mme-run.sh |
| 181 | subPath: mme-run.sh |
| 182 | - name: shared-data |
| 183 | mountPath: /opt/mme/config/shared |
| 184 | - name: shared-app |
| 185 | mountPath: /tmp |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 186 | {{- if .Values.config.coreDump.enabled }} |
| 187 | - name: coredump |
| 188 | mountPath: /tmp/coredump |
| 189 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 190 | - name: s11-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 191 | image: {{ .Values.images.tags.mme | quote }} |
| 192 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 193 | {{- if .Values.config.coreDump.enabled }} |
| 194 | securityContext: |
| 195 | privileged: true |
| 196 | runAsUser: 0 |
| 197 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 198 | command: ["bash", "-xc"] |
| 199 | args: |
| 200 | - /opt/mme/scripts/mme-run.sh s11-app |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 201 | {{- if .Values.resources.enabled }} |
| 202 | resources: |
| 203 | {{ toYaml .Values.resources.mme | indent 10 }} |
| 204 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 205 | volumeMounts: |
| 206 | - name: scripts |
| 207 | mountPath: /opt/mme/scripts/mme-run.sh |
| 208 | subPath: mme-run.sh |
| 209 | - name: shared-data |
| 210 | mountPath: /opt/mme/config/shared |
| 211 | - name: shared-app |
| 212 | mountPath: /tmp |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 213 | {{- if .Values.config.coreDump.enabled }} |
| 214 | - name: coredump |
| 215 | mountPath: /tmp/coredump |
| 216 | {{- end }} |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 217 | volumes: |
| 218 | - name: scripts |
| 219 | configMap: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 220 | name: mme |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 221 | defaultMode: 493 |
| 222 | - name: configs |
| 223 | configMap: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 224 | name: mme |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 225 | defaultMode: 420 |
| 226 | - name: shared-data |
| 227 | emptyDir: {} |
| 228 | - name: shared-app |
| 229 | emptyDir: {} |
Hyunsun Moon | ece8698 | 2019-09-27 17:44:59 -0500 | [diff] [blame] | 230 | - name: host-rootfs |
| 231 | hostPath: |
| 232 | path: / |
Hyunsun Moon | ec0b44d | 2020-01-10 15:50:53 -0700 | [diff] [blame] | 233 | {{- if .Values.config.coreDump.enabled }} |
| 234 | - name: coredump |
| 235 | hostPath: |
| 236 | path: {{ .Values.config.coreDump.path }} |
| 237 | {{- end }} |