blob: ac574ce9a6c84f1fe35c5650369db1c5d557e436 [file] [log] [blame]
badhri854c028b32021-11-03 18:24:05 -05001{{/*
2# Copyright 2019-present Open Networking Foundation
3
Ajay Lotan Thakur03189d22022-02-10 14:06:03 -06004# SPDX-License-Identifier: Apache-2.0
badhri854c028b32021-11-03 18:24:05 -05005*/}}
6
7{{- if .Values.config.mme.deploy }}
8{{ tuple "mme" . | include "omec-control-plane.service_account" }}
9---
10apiVersion: apps/v1
11kind: StatefulSet
12metadata:
13 name: mme
14 labels:
15{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
16spec:
17 replicas: 1
18 serviceName: mme-headless
19 selector:
20 matchLabels:
21{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 6 }}
22 template:
23 metadata:
24 labels:
25{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 8 }}
26 {{- with .Values.config.mme.podAnnotations }}
27 annotations:
28 {{- toYaml . | nindent 8 }}
29 {{- end }}
30 spec:
31 {{- if .Values.nodeSelectors.enabled }}
32 nodeSelector:
33 {{ .Values.nodeSelectors.mme.label }}: {{ .Values.nodeSelectors.mme.value }}
34 {{- end }}
35 serviceAccountName: mme
36 {{- if hasKey .Values.images "pullSecrets" }}
37 imagePullSecrets:
38{{ toYaml .Values.images.pullSecrets | indent 8 }}
39 {{- end }}
40 initContainers:
41 - name: mme-load-sctp-module
Ajay Lotan Thakur71115fe2022-03-03 22:26:08 -070042 image: {{ .Values.images.repository }}{{ .Values.images.tags.init }}
badhri854c028b32021-11-03 18:24:05 -050043 imagePullPolicy: {{ .Values.images.pullPolicy }}
44 securityContext:
45 privileged: true
46 runAsUser: 0
47 command: ["sh", "-xc"]
48 args:
49 - |
50 if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \
51 chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \
52 fi;
53 chroot /mnt/host-rootfs modprobe tipc
54 volumeMounts:
55 - name: host-rootfs
56 mountPath: /mnt/host-rootfs
57 {{- if .Values.config.hss.deploy }}
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 {{- end }}
88 - name: mme-init
Ajay Lotan Thakur71115fe2022-03-03 22:26:08 -070089 image: {{ .Values.images.repository }}{{ .Values.images.tags.mme }}
badhri854c028b32021-11-03 18:24:05 -050090 imagePullPolicy: {{ .Values.images.pullPolicy }}
91 command: ["/opt/mme/scripts/mme-init.sh"]
92 env:
93 - name: POD_IP
94 valueFrom:
95 fieldRef:
96 fieldPath: status.podIP
97 volumeMounts:
98 - name: scripts
99 mountPath: /opt/mme/scripts
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
Ajay Lotan Thakur71115fe2022-03-03 22:26:08 -0700109 image: {{ .Values.images.repository }}{{ .Values.images.tags.mme }}
badhri854c028b32021-11-03 18:24:05 -0500110 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 {{- if .Values.config.managedByConfigPod.enabled }}
131 - name: MANAGED_BY_CONFIG_POD
132 value: "true"
133 {{- end }}
134 volumeMounts:
135 - name: scripts
136 mountPath: /opt/mme/scripts
137 - name: shared-data
138 mountPath: /opt/mme/config/shared
139 - name: shared-app
140 mountPath: /tmp
141 - name: configs
142 mountPath: /opt/mme/config
143 {{- if .Values.config.coreDump.enabled }}
144 - name: coredump
145 mountPath: /tmp/coredump
146 {{- end }}
147 - name: s1ap-app
Ajay Lotan Thakur71115fe2022-03-03 22:26:08 -0700148 image: {{ .Values.images.repository }}{{ .Values.images.tags.mme }}
badhri854c028b32021-11-03 18:24:05 -0500149 imagePullPolicy: {{ .Values.images.pullPolicy }}
150 {{- if .Values.config.coreDump.enabled }}
151 securityContext:
152 privileged: true
153 runAsUser: 0
154 {{- end }}
155 command: ["bash", "-xc"]
156 args:
157 - /opt/mme/scripts/mme-run.sh s1ap-app
158 {{- if .Values.resources.enabled }}
159 resources:
160{{ toYaml .Values.resources.mme | indent 10 }}
161 {{- end }}
162 env:
163 - name: MMERUNENV
164 value: "container"
165 {{- if .Values.config.managedByConfigPod.enabled }}
166 - name: MANAGED_BY_CONFIG_POD
167 value: "true"
168 {{- end }}
169 volumeMounts:
170 - name: scripts
171 mountPath: /opt/mme/scripts
172 - name: shared-data
173 mountPath: /opt/mme/config/shared
174 - name: shared-app
175 mountPath: /tmp
176 - name: configs
177 mountPath: /opt/mme/config
178 {{- if .Values.config.coreDump.enabled }}
179 - name: coredump
180 mountPath: /tmp/coredump
181 {{- end }}
182 - name: s6a-app
Ajay Lotan Thakur71115fe2022-03-03 22:26:08 -0700183 image: {{ .Values.images.repository }}{{ .Values.images.tags.mme }}
badhri854c028b32021-11-03 18:24:05 -0500184 imagePullPolicy: {{ .Values.images.pullPolicy }}
185 {{- if .Values.config.coreDump.enabled }}
186 securityContext:
187 privileged: true
188 runAsUser: 0
189 {{- end }}
190 command: ["bash", "-xc"]
191 args:
192 - /opt/mme/scripts/mme-run.sh s6a-app
193 {{- if .Values.resources.enabled }}
194 resources:
195{{ toYaml .Values.resources.mme | indent 10 }}
196 {{- end }}
197 env:
198 - name: MMERUNENV
199 value: "container"
200 {{- if .Values.config.managedByConfigPod.enabled }}
201 - name: MANAGED_BY_CONFIG_POD
202 value: "true"
203 {{- end }}
204 volumeMounts:
205 - name: scripts
206 mountPath: /opt/mme/scripts
207 - name: shared-data
208 mountPath: /opt/mme/config/shared
209 - name: shared-app
210 mountPath: /tmp
211 {{- if .Values.config.coreDump.enabled }}
212 - name: coredump
213 mountPath: /tmp/coredump
214 {{- end }}
215 - name: s11-app
Ajay Lotan Thakur71115fe2022-03-03 22:26:08 -0700216 image: {{ .Values.images.repository }}{{ .Values.images.tags.mme }}
badhri854c028b32021-11-03 18:24:05 -0500217 imagePullPolicy: {{ .Values.images.pullPolicy }}
218 {{- if .Values.config.coreDump.enabled }}
219 securityContext:
220 privileged: true
221 runAsUser: 0
222 {{- end }}
223 command: ["bash", "-xc"]
224 args:
225 - /opt/mme/scripts/mme-run.sh s11-app
226 {{- if .Values.resources.enabled }}
227 resources:
228{{ toYaml .Values.resources.mme | indent 10 }}
229 {{- end }}
230 env:
231 - name: MMERUNENV
232 value: "container"
233 {{- if .Values.config.managedByConfigPod.enabled }}
234 - name: MANAGED_BY_CONFIG_POD
235 value: "true"
236 {{- end }}
237 volumeMounts:
238 - name: scripts
239 mountPath: /opt/mme/scripts
240 - name: shared-data
241 mountPath: /opt/mme/config/shared
242 - name: shared-app
243 mountPath: /tmp
244 {{- if .Values.config.coreDump.enabled }}
245 - name: coredump
246 mountPath: /tmp/coredump
247 {{- end }}
248 volumes:
249 - name: scripts
250 configMap:
251 name: mme-scripts
252 defaultMode: 493
253 - name: configs
254 configMap:
255 name: mme-configs
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 }}
269{{- end }}