blob: 3560344436e7e42c9ba4d9543812faf3977e2fdf [file] [log] [blame]
Hyunsun Moon06f98552019-08-15 13:44:47 -06001{{/*
2Copyright 2019-present Open Networking Foundation
Hyunsun Moon636e17d2019-07-03 12:52:15 -05003
Hyunsun Moon06f98552019-08-15 13:44:47 -06004Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
Hyunsun Moon636e17d2019-07-03 12:52:15 -05007
Hyunsun Moon06f98552019-08-15 13:44:47 -06008http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/}}
16
Hyunsun Moon16d70922019-08-25 04:57:25 -050017{{ tuple "mme" . | include "omec-control-plane.service_account" }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050018---
19apiVersion: apps/v1
20kind: StatefulSet
21metadata:
Hyunsun Moon06f98552019-08-15 13:44:47 -060022 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -050023 labels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060024{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050025spec:
26 replicas: 1
Hyunsun Moon834c28f2019-12-05 18:26:22 -080027 serviceName: mme-headless
Hyunsun Moon636e17d2019-07-03 12:52:15 -050028 selector:
29 matchLabels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060030{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 6 }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050031 template:
32 metadata:
33 labels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060034{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 8 }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050035 spec:
Hyunsun Moon06f98552019-08-15 13:44:47 -060036 {{- if .Values.nodeSelectors.enabled }}
37 nodeSelector:
38 {{ .Values.nodeSelectors.mme.label }}: {{ .Values.nodeSelectors.mme.value }}
39 {{- end }}
40 serviceAccountName: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -050041 initContainers:
Hyunsun Moonece86982019-09-27 17:44:59 -050042 - 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 Thakur8418c172020-04-23 16:30:43 +000050 - |
Hyunsun Moonece86982019-09-27 17:44:59 -050051 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 Moonec0b44d2020-01-10 15:50:53 -070053 fi;
Ajay Lotan Thakur8418c172020-04-23 16:30:43 +000054 chroot /mnt/host-rootfs modprobe tipc
Hyunsun Moonece86982019-09-27 17:44:59 -050055 volumeMounts:
56 - name: host-rootfs
57 mountPath: /mnt/host-rootfs
Hyunsun Moon636e17d2019-07-03 12:52:15 -050058 - name: mme-dep-check
Hyunsun Moon06f98552019-08-15 13:44:47 -060059 image: {{ .Values.images.tags.depCheck | quote }}
60 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050061 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 Moon16d70922019-08-25 04:57:25 -050081 value: '[{"labels": {"app": "hss"}, "requireSameNode": false}]'
Hyunsun Moon636e17d2019-07-03 12:52:15 -050082 # add dependency job for make_certs.sh
83 command:
84 - kubernetes-entrypoint
85 volumeMounts:
86 []
87 - name: mme-init
Hyunsun Moon06f98552019-08-15 13:44:47 -060088 image: {{ .Values.images.tags.mme | quote }}
89 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050090 command: ["/opt/mme/scripts/mme-init.sh"]
91 env:
Hyunsun Moon16d70922019-08-25 04:57:25 -050092 - name: POD_IP
Hyunsun Moon636e17d2019-07-03 12:52:15 -050093 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 Moonec0b44d2020-01-10 15:50:53 -0700104 {{- if .Values.config.coreDump.enabled }}
105{{ tuple "mme" . | include "omec-control-plane.coredump_init" | indent 6 }}
106 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500107 containers:
108 - name: mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600109 image: {{ .Values.images.tags.mme | quote }}
110 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700111 {{- if .Values.config.coreDump.enabled }}
112 securityContext:
113 privileged: true
114 runAsUser: 0
115 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500116 command: ["bash", "-xc"]
117 args:
118 - /opt/mme/scripts/mme-run.sh mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600119 {{- if .Values.resources.enabled }}
120 resources:
121{{ toYaml .Values.resources.mme | indent 10 }}
122 {{- end }}
Ajay Lotan Thakur0e134ec2020-04-02 12:31:53 -0600123 env:
124 - name: POD_IP
125 valueFrom:
126 fieldRef:
127 fieldPath: status.podIP
Ajay Lotan Thakur8418c172020-04-23 16:30:43 +0000128 - name: MMERUNENV
129 value: "container"
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500130 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 Moonec0b44d2020-01-10 15:50:53 -0700138 - name: configs
139 mountPath: /opt/mme/config
140 {{- if .Values.config.coreDump.enabled }}
141 - name: coredump
142 mountPath: /tmp/coredump
143 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500144 - name: s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600145 image: {{ .Values.images.tags.mme | quote }}
146 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700147 {{- if .Values.config.coreDump.enabled }}
148 securityContext:
149 privileged: true
150 runAsUser: 0
151 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500152 command: ["bash", "-xc"]
153 args:
154 - /opt/mme/scripts/mme-run.sh s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600155 {{- if .Values.resources.enabled }}
156 resources:
157{{ toYaml .Values.resources.mme | indent 10 }}
158 {{- end }}
Ajay Lotan Thakur8418c172020-04-23 16:30:43 +0000159 env:
160 - name: MMERUNENV
161 value: "container"
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500162 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 Thakur0e134ec2020-04-02 12:31:53 -0600170 - name: configs
171 mountPath: /opt/mme/config
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700172 {{- if .Values.config.coreDump.enabled }}
173 - name: coredump
174 mountPath: /tmp/coredump
175 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500176 - name: s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600177 image: {{ .Values.images.tags.mme | quote }}
178 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700179 {{- if .Values.config.coreDump.enabled }}
180 securityContext:
181 privileged: true
182 runAsUser: 0
183 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500184 command: ["bash", "-xc"]
185 args:
186 - /opt/mme/scripts/mme-run.sh s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600187 {{- if .Values.resources.enabled }}
188 resources:
189{{ toYaml .Values.resources.mme | indent 10 }}
190 {{- end }}
Ajay Lotan Thakur8418c172020-04-23 16:30:43 +0000191 env:
192 - name: MMERUNENV
193 value: "container"
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500194 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 Moonec0b44d2020-01-10 15:50:53 -0700202 {{- if .Values.config.coreDump.enabled }}
203 - name: coredump
204 mountPath: /tmp/coredump
205 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500206 - name: s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600207 image: {{ .Values.images.tags.mme | quote }}
208 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700209 {{- if .Values.config.coreDump.enabled }}
210 securityContext:
211 privileged: true
212 runAsUser: 0
213 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500214 command: ["bash", "-xc"]
215 args:
216 - /opt/mme/scripts/mme-run.sh s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600217 {{- if .Values.resources.enabled }}
218 resources:
219{{ toYaml .Values.resources.mme | indent 10 }}
220 {{- end }}
Ajay Lotan Thakur8418c172020-04-23 16:30:43 +0000221 env:
222 - name: MMERUNENV
223 value: "container"
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500224 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 Moonec0b44d2020-01-10 15:50:53 -0700232 {{- if .Values.config.coreDump.enabled }}
233 - name: coredump
234 mountPath: /tmp/coredump
235 {{- end }}
Woojoong Kimf6ba8702020-01-24 12:49:05 -0800236 {{- 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 Kimdde90e32020-02-18 14:43:18 -0800244 - 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 Kimf6ba8702020-01-24 12:49:05 -0800248 {{- if .Values.resources.enabled }}
249 resources:
250{{ toYaml .Values.resources.mme | indent 10 }}
251 {{- end }}
252 volumeMounts:
Woojoong Kimdde90e32020-02-18 14:43:18 -0800253 - name: shared-data
254 mountPath: /opt/mme/config/shared
Woojoong Kimf6ba8702020-01-24 12:49:05 -0800255 - name: shared-app
256 mountPath: /tmp
257 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500258 volumes:
259 - name: scripts
260 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600261 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500262 defaultMode: 493
263 - name: configs
264 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600265 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500266 defaultMode: 420
267 - name: shared-data
268 emptyDir: {}
269 - name: shared-app
270 emptyDir: {}
Hyunsun Moonece86982019-09-27 17:44:59 -0500271 - name: host-rootfs
272 hostPath:
273 path: /
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700274 {{- if .Values.config.coreDump.enabled }}
275 - name: coredump
276 hostPath:
277 path: {{ .Values.config.coreDump.path }}
278 {{- end }}