blob: 9cf10c276f403c74763f3f0d975904c6bca4b5f3 [file] [log] [blame]
Jeremy Ronquillo223db002020-06-05 10:28:22 -07001{{/*
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07002# Copyright 2019-present Open Networking Foundation
Jeremy Ronquillo223db002020-06-05 10:28:22 -07003
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07004# SPDX-License-Identifier: Apache-2.0
5# SPDX-License-Identifier: LicenseRef-ONF-Member-Only
Jeremy Ronquillo223db002020-06-05 10:28:22 -07006*/}}
7
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 spec:
27 {{- if .Values.nodeSelectors.enabled }}
28 nodeSelector:
29 {{ .Values.nodeSelectors.mme.label }}: {{ .Values.nodeSelectors.mme.value }}
30 {{- end }}
31 serviceAccountName: mme
32 initContainers:
33 - name: mme-load-sctp-module
34 image: {{ .Values.images.tags.init | quote }}
35 imagePullPolicy: {{ .Values.images.pullPolicy }}
36 securityContext:
37 privileged: true
38 runAsUser: 0
39 command: ["bash", "-xc"]
40 args:
41 - |
42 if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \
43 chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \
44 fi;
45 chroot /mnt/host-rootfs modprobe tipc
46 volumeMounts:
47 - name: host-rootfs
48 mountPath: /mnt/host-rootfs
49 - name: mme-dep-check
50 image: {{ .Values.images.tags.depCheck | quote }}
51 imagePullPolicy: {{ .Values.images.pullPolicy }}
52 securityContext:
53 allowPrivilegeEscalation: false
54 readOnlyRootFilesystem: false
55 runAsUser: 0
56 env:
57 - name: POD_NAME
58 valueFrom:
59 fieldRef:
60 apiVersion: v1
61 fieldPath: metadata.name
62 - name: NAMESPACE
63 valueFrom:
64 fieldRef:
65 apiVersion: v1
66 fieldPath: metadata.namespace
67 - name: PATH
68 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
69 - name: COMMAND
70 value: "echo done"
71 - name: DEPENDENCY_POD_JSON
72 value: '[{"labels": {"app": "hss"}, "requireSameNode": false}]'
73 # add dependency job for make_certs.sh
74 command:
75 - kubernetes-entrypoint
76 volumeMounts:
77 []
78 - name: mme-init
79 image: {{ .Values.images.tags.mme | quote }}
80 imagePullPolicy: {{ .Values.images.pullPolicy }}
81 command: ["/opt/mme/scripts/mme-init.sh"]
82 env:
83 - name: POD_IP
84 valueFrom:
85 fieldRef:
86 fieldPath: status.podIP
87 volumeMounts:
88 - name: scripts
89 mountPath: /opt/mme/scripts/mme-init.sh
90 subPath: mme-init.sh
91 - name: configs
92 mountPath: /opt/mme/config
93 - name: shared-data
94 mountPath: /opt/mme/config/shared
95 {{- if .Values.config.coreDump.enabled }}
96{{ tuple "mme" . | include "omec-control-plane.coredump_init" | indent 6 }}
97 {{- end }}
98 containers:
99 - name: mme-app
100 image: {{ .Values.images.tags.mme | quote }}
101 imagePullPolicy: {{ .Values.images.pullPolicy }}
102 {{- if .Values.config.coreDump.enabled }}
103 securityContext:
104 privileged: true
105 runAsUser: 0
106 {{- end }}
107 command: ["bash", "-xc"]
108 args:
109 - /opt/mme/scripts/mme-run.sh mme-app
110 {{- if .Values.resources.enabled }}
111 resources:
112{{ toYaml .Values.resources.mme | indent 10 }}
113 {{- end }}
114 env:
115 - name: POD_IP
116 valueFrom:
117 fieldRef:
118 fieldPath: status.podIP
119 - name: MMERUNENV
120 value: "container"
121 volumeMounts:
122 - name: scripts
123 mountPath: /opt/mme/scripts/mme-run.sh
124 subPath: mme-run.sh
125 - name: shared-data
126 mountPath: /opt/mme/config/shared
127 - name: shared-app
128 mountPath: /tmp
129 - name: configs
130 mountPath: /opt/mme/config
131 {{- if .Values.config.coreDump.enabled }}
132 - name: coredump
133 mountPath: /tmp/coredump
134 {{- end }}
135 - name: s1ap-app
136 image: {{ .Values.images.tags.mme | quote }}
137 imagePullPolicy: {{ .Values.images.pullPolicy }}
138 {{- if .Values.config.coreDump.enabled }}
139 securityContext:
140 privileged: true
141 runAsUser: 0
142 {{- end }}
143 command: ["bash", "-xc"]
144 args:
145 - /opt/mme/scripts/mme-run.sh s1ap-app
146 {{- if .Values.resources.enabled }}
147 resources:
148{{ toYaml .Values.resources.mme | indent 10 }}
149 {{- end }}
150 env:
151 - name: MMERUNENV
152 value: "container"
153 volumeMounts:
154 - name: scripts
155 mountPath: /opt/mme/scripts/mme-run.sh
156 subPath: mme-run.sh
157 - name: shared-data
158 mountPath: /opt/mme/config/shared
159 - name: shared-app
160 mountPath: /tmp
161 - name: configs
162 mountPath: /opt/mme/config
163 {{- if .Values.config.coreDump.enabled }}
164 - name: coredump
165 mountPath: /tmp/coredump
166 {{- end }}
167 - name: s6a-app
168 image: {{ .Values.images.tags.mme | quote }}
169 imagePullPolicy: {{ .Values.images.pullPolicy }}
170 {{- if .Values.config.coreDump.enabled }}
171 securityContext:
172 privileged: true
173 runAsUser: 0
174 {{- end }}
175 command: ["bash", "-xc"]
176 args:
177 - /opt/mme/scripts/mme-run.sh s6a-app
178 {{- if .Values.resources.enabled }}
179 resources:
180{{ toYaml .Values.resources.mme | indent 10 }}
181 {{- end }}
182 env:
183 - name: MMERUNENV
184 value: "container"
185 volumeMounts:
186 - name: scripts
187 mountPath: /opt/mme/scripts/mme-run.sh
188 subPath: mme-run.sh
189 - name: shared-data
190 mountPath: /opt/mme/config/shared
191 - name: shared-app
192 mountPath: /tmp
193 {{- if .Values.config.coreDump.enabled }}
194 - name: coredump
195 mountPath: /tmp/coredump
196 {{- end }}
197 - name: s11-app
198 image: {{ .Values.images.tags.mme | quote }}
199 imagePullPolicy: {{ .Values.images.pullPolicy }}
200 {{- if .Values.config.coreDump.enabled }}
201 securityContext:
202 privileged: true
203 runAsUser: 0
204 {{- end }}
205 command: ["bash", "-xc"]
206 args:
207 - /opt/mme/scripts/mme-run.sh s11-app
208 {{- if .Values.resources.enabled }}
209 resources:
210{{ toYaml .Values.resources.mme | indent 10 }}
211 {{- end }}
212 env:
213 - name: MMERUNENV
214 value: "container"
215 volumeMounts:
216 - name: scripts
217 mountPath: /opt/mme/scripts/mme-run.sh
218 subPath: mme-run.sh
219 - name: shared-data
220 mountPath: /opt/mme/config/shared
221 - name: shared-app
222 mountPath: /tmp
223 {{- if .Values.config.coreDump.enabled }}
224 - name: coredump
225 mountPath: /tmp/coredump
226 {{- end }}
227 {{- if .Values.prometheusExporter.mme.enabled }}
228 - name: subscriber-exporter
229 image: {{ .Values.images.tags.mmeExporter }}
230 imagePullPolicy: {{ .Values.images.pullPolicy }}
231 securityContext:
232 privileged: true
233 command: ["bash", "-xc"]
234 args:
235 - cp /opt/mme/config/shared/mme_exporter.json /openmme/conf/mme_exporter.json;
236 until [ -e /tmp/unix_socket ]; do sleep 1; done;
237 chmod 777 /tmp/unix_socket;
238 while true; do python3 monitor_client.py; sleep 1; done;
239 {{- if .Values.resources.enabled }}
240 resources:
241{{ toYaml .Values.resources.mme | indent 10 }}
242 {{- end }}
243 volumeMounts:
244 - name: shared-data
245 mountPath: /opt/mme/config/shared
246 - name: shared-app
247 mountPath: /tmp
248 {{- end }}
249 volumes:
250 - name: scripts
251 configMap:
252 name: mme
253 defaultMode: 493
254 - name: configs
255 configMap:
256 name: mme
257 defaultMode: 420
258 - name: shared-data
259 emptyDir: {}
260 - name: shared-app
261 emptyDir: {}
262 - name: host-rootfs
263 hostPath:
264 path: /
265 {{- if .Values.config.coreDump.enabled }}
266 - name: coredump
267 hostPath:
268 path: {{ .Values.config.coreDump.path }}
269 {{- end }}