blob: 3560344436e7e42c9ba4d9543812faf3977e2fdf [file] [log] [blame]
Jeremy Ronquillo223db002020-06-05 10:28:22 -07001{{/*
2Copyright 2019-present Open Networking Foundation
3
4Licensed 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
7
8http://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
17{{ tuple "mme" . | include "omec-control-plane.service_account" }}
18---
19apiVersion: apps/v1
20kind: StatefulSet
21metadata:
22 name: mme
23 labels:
24{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
25spec:
26 replicas: 1
27 serviceName: mme-headless
28 selector:
29 matchLabels:
30{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 6 }}
31 template:
32 metadata:
33 labels:
34{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 8 }}
35 spec:
36 {{- if .Values.nodeSelectors.enabled }}
37 nodeSelector:
38 {{ .Values.nodeSelectors.mme.label }}: {{ .Values.nodeSelectors.mme.value }}
39 {{- end }}
40 serviceAccountName: mme
41 initContainers:
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; \
53 fi;
54 chroot /mnt/host-rootfs modprobe tipc
55 volumeMounts:
56 - name: host-rootfs
57 mountPath: /mnt/host-rootfs
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 []
87 - name: mme-init
88 image: {{ .Values.images.tags.mme | quote }}
89 imagePullPolicy: {{ .Values.images.pullPolicy }}
90 command: ["/opt/mme/scripts/mme-init.sh"]
91 env:
92 - name: POD_IP
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
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"
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
138 - name: configs
139 mountPath: /opt/mme/config
140 {{- if .Values.config.coreDump.enabled }}
141 - name: coredump
142 mountPath: /tmp/coredump
143 {{- end }}
144 - name: s1ap-app
145 image: {{ .Values.images.tags.mme | quote }}
146 imagePullPolicy: {{ .Values.images.pullPolicy }}
147 {{- if .Values.config.coreDump.enabled }}
148 securityContext:
149 privileged: true
150 runAsUser: 0
151 {{- end }}
152 command: ["bash", "-xc"]
153 args:
154 - /opt/mme/scripts/mme-run.sh s1ap-app
155 {{- if .Values.resources.enabled }}
156 resources:
157{{ toYaml .Values.resources.mme | indent 10 }}
158 {{- end }}
159 env:
160 - name: MMERUNENV
161 value: "container"
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
170 - name: configs
171 mountPath: /opt/mme/config
172 {{- if .Values.config.coreDump.enabled }}
173 - name: coredump
174 mountPath: /tmp/coredump
175 {{- end }}
176 - name: s6a-app
177 image: {{ .Values.images.tags.mme | quote }}
178 imagePullPolicy: {{ .Values.images.pullPolicy }}
179 {{- if .Values.config.coreDump.enabled }}
180 securityContext:
181 privileged: true
182 runAsUser: 0
183 {{- end }}
184 command: ["bash", "-xc"]
185 args:
186 - /opt/mme/scripts/mme-run.sh s6a-app
187 {{- if .Values.resources.enabled }}
188 resources:
189{{ toYaml .Values.resources.mme | indent 10 }}
190 {{- end }}
191 env:
192 - name: MMERUNENV
193 value: "container"
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
202 {{- if .Values.config.coreDump.enabled }}
203 - name: coredump
204 mountPath: /tmp/coredump
205 {{- end }}
206 - name: s11-app
207 image: {{ .Values.images.tags.mme | quote }}
208 imagePullPolicy: {{ .Values.images.pullPolicy }}
209 {{- if .Values.config.coreDump.enabled }}
210 securityContext:
211 privileged: true
212 runAsUser: 0
213 {{- end }}
214 command: ["bash", "-xc"]
215 args:
216 - /opt/mme/scripts/mme-run.sh s11-app
217 {{- if .Values.resources.enabled }}
218 resources:
219{{ toYaml .Values.resources.mme | indent 10 }}
220 {{- end }}
221 env:
222 - name: MMERUNENV
223 value: "container"
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
232 {{- if .Values.config.coreDump.enabled }}
233 - name: coredump
234 mountPath: /tmp/coredump
235 {{- end }}
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:
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;
248 {{- if .Values.resources.enabled }}
249 resources:
250{{ toYaml .Values.resources.mme | indent 10 }}
251 {{- end }}
252 volumeMounts:
253 - name: shared-data
254 mountPath: /opt/mme/config/shared
255 - name: shared-app
256 mountPath: /tmp
257 {{- end }}
258 volumes:
259 - name: scripts
260 configMap:
261 name: mme
262 defaultMode: 493
263 - name: configs
264 configMap:
265 name: mme
266 defaultMode: 420
267 - name: shared-data
268 emptyDir: {}
269 - name: shared-app
270 emptyDir: {}
271 - name: host-rootfs
272 hostPath:
273 path: /
274 {{- if .Values.config.coreDump.enabled }}
275 - name: coredump
276 hostPath:
277 path: {{ .Values.config.coreDump.path }}
278 {{- end }}