blob: aff54e90861c9845c5837a9e9865db9c15c0f3d4 [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:
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 Moonec0b44d2020-01-10 15:50:53 -070053 fi;
Hyunsun Moonece86982019-09-27 17:44:59 -050054 volumeMounts:
55 - name: host-rootfs
56 mountPath: /mnt/host-rootfs
Hyunsun Moon636e17d2019-07-03 12:52:15 -050057 - name: mme-dep-check
Hyunsun Moon06f98552019-08-15 13:44:47 -060058 image: {{ .Values.images.tags.depCheck | quote }}
59 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050060 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 Moon16d70922019-08-25 04:57:25 -050080 value: '[{"labels": {"app": "hss"}, "requireSameNode": false}]'
Hyunsun Moon636e17d2019-07-03 12:52:15 -050081 # add dependency job for make_certs.sh
82 command:
83 - kubernetes-entrypoint
84 volumeMounts:
85 []
86 - name: mme-init
Hyunsun Moon06f98552019-08-15 13:44:47 -060087 image: {{ .Values.images.tags.mme | quote }}
88 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050089 command: ["/opt/mme/scripts/mme-init.sh"]
90 env:
Hyunsun Moon16d70922019-08-25 04:57:25 -050091 - name: POD_IP
Hyunsun Moon636e17d2019-07-03 12:52:15 -050092 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 Moonec0b44d2020-01-10 15:50:53 -0700103 {{- if .Values.config.coreDump.enabled }}
104{{ tuple "mme" . | include "omec-control-plane.coredump_init" | indent 6 }}
105 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500106 containers:
107 - name: mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600108 image: {{ .Values.images.tags.mme | quote }}
109 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700110 {{- if .Values.config.coreDump.enabled }}
111 securityContext:
112 privileged: true
113 runAsUser: 0
114 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500115 command: ["bash", "-xc"]
116 args:
117 - /opt/mme/scripts/mme-run.sh mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600118 {{- if .Values.resources.enabled }}
119 resources:
120{{ toYaml .Values.resources.mme | indent 10 }}
121 {{- end }}
Ajay Lotan Thakur0e134ec2020-04-02 12:31:53 -0600122 env:
123 - name: POD_IP
124 valueFrom:
125 fieldRef:
126 fieldPath: status.podIP
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500127 volumeMounts:
128 - name: scripts
129 mountPath: /opt/mme/scripts/mme-run.sh
130 subPath: mme-run.sh
131 - name: shared-data
132 mountPath: /opt/mme/config/shared
133 - name: shared-app
134 mountPath: /tmp
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700135 - name: configs
136 mountPath: /opt/mme/config
137 {{- if .Values.config.coreDump.enabled }}
138 - name: coredump
139 mountPath: /tmp/coredump
140 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500141 - name: s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600142 image: {{ .Values.images.tags.mme | quote }}
143 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700144 {{- if .Values.config.coreDump.enabled }}
145 securityContext:
146 privileged: true
147 runAsUser: 0
148 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500149 command: ["bash", "-xc"]
150 args:
151 - /opt/mme/scripts/mme-run.sh s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600152 {{- if .Values.resources.enabled }}
153 resources:
154{{ toYaml .Values.resources.mme | indent 10 }}
155 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500156 volumeMounts:
157 - name: scripts
158 mountPath: /opt/mme/scripts/mme-run.sh
159 subPath: mme-run.sh
160 - name: shared-data
161 mountPath: /opt/mme/config/shared
162 - name: shared-app
163 mountPath: /tmp
Ajay Lotan Thakur0e134ec2020-04-02 12:31:53 -0600164 - name: configs
165 mountPath: /opt/mme/config
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700166 {{- if .Values.config.coreDump.enabled }}
167 - name: coredump
168 mountPath: /tmp/coredump
169 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500170 - name: s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600171 image: {{ .Values.images.tags.mme | quote }}
172 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700173 {{- if .Values.config.coreDump.enabled }}
174 securityContext:
175 privileged: true
176 runAsUser: 0
177 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500178 command: ["bash", "-xc"]
179 args:
180 - /opt/mme/scripts/mme-run.sh s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600181 {{- if .Values.resources.enabled }}
182 resources:
183{{ toYaml .Values.resources.mme | indent 10 }}
184 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500185 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
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700193 {{- if .Values.config.coreDump.enabled }}
194 - name: coredump
195 mountPath: /tmp/coredump
196 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500197 - name: s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600198 image: {{ .Values.images.tags.mme | quote }}
199 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700200 {{- if .Values.config.coreDump.enabled }}
201 securityContext:
202 privileged: true
203 runAsUser: 0
204 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500205 command: ["bash", "-xc"]
206 args:
207 - /opt/mme/scripts/mme-run.sh s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600208 {{- if .Values.resources.enabled }}
209 resources:
210{{ toYaml .Values.resources.mme | indent 10 }}
211 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500212 volumeMounts:
213 - name: scripts
214 mountPath: /opt/mme/scripts/mme-run.sh
215 subPath: mme-run.sh
216 - name: shared-data
217 mountPath: /opt/mme/config/shared
218 - name: shared-app
219 mountPath: /tmp
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700220 {{- if .Values.config.coreDump.enabled }}
221 - name: coredump
222 mountPath: /tmp/coredump
223 {{- end }}
Woojoong Kimf6ba8702020-01-24 12:49:05 -0800224 {{- if .Values.prometheusExporter.mme.enabled }}
225 - name: subscriber-exporter
226 image: {{ .Values.images.tags.mmeExporter }}
227 imagePullPolicy: {{ .Values.images.pullPolicy }}
228 securityContext:
229 privileged: true
230 command: ["bash", "-xc"]
231 args:
Woojoong Kimdde90e32020-02-18 14:43:18 -0800232 - cp /opt/mme/config/shared/mme_exporter.json /openmme/conf/mme_exporter.json;
233 until [ -e /tmp/unix_socket ]; do sleep 1; done;
234 chmod 777 /tmp/unix_socket;
235 while true; do python3 monitor_client.py; sleep 1; done;
Woojoong Kimf6ba8702020-01-24 12:49:05 -0800236 {{- if .Values.resources.enabled }}
237 resources:
238{{ toYaml .Values.resources.mme | indent 10 }}
239 {{- end }}
240 volumeMounts:
Woojoong Kimdde90e32020-02-18 14:43:18 -0800241 - name: shared-data
242 mountPath: /opt/mme/config/shared
Woojoong Kimf6ba8702020-01-24 12:49:05 -0800243 - name: shared-app
244 mountPath: /tmp
245 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500246 volumes:
247 - name: scripts
248 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600249 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500250 defaultMode: 493
251 - name: configs
252 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600253 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500254 defaultMode: 420
255 - name: shared-data
256 emptyDir: {}
257 - name: shared-app
258 emptyDir: {}
Hyunsun Moonece86982019-09-27 17:44:59 -0500259 - name: host-rootfs
260 hostPath:
261 path: /
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700262 {{- if .Values.config.coreDump.enabled }}
263 - name: coredump
264 hostPath:
265 path: {{ .Values.config.coreDump.path }}
266 {{- end }}