blob: d690bb5ec814981682b114e2cac14d7d7e1e4376 [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 Ronquillo6046ce32020-06-18 11:06:29 -07004# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
Jeremy Ronquillo223db002020-06-05 10:28:22 -07005*/}}
6
Hyunsun Moon83ff7352020-07-09 11:03:52 -07007{{- if .Values.config.mme.deploy }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -07008{{ 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 }}
Andy Bavierba196552020-09-17 13:58:04 -070026 {{- with .Values.config.mme.podAnnotations }}
27 annotations:
28 {{- toYaml . | nindent 8 }}
29 {{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070030 spec:
31 {{- if .Values.nodeSelectors.enabled }}
32 nodeSelector:
33 {{ .Values.nodeSelectors.mme.label }}: {{ .Values.nodeSelectors.mme.value }}
34 {{- end }}
35 serviceAccountName: mme
Hyunsun Moond9a09e82021-03-17 12:16:53 -070036 {{- if hasKey .Values.images "pullSecrets" }}
Hyunsun Moon8da17882020-10-14 21:28:44 -050037 imagePullSecrets:
Hyunsun Moond9a09e82021-03-17 12:16:53 -070038{{ toYaml .Values.images.pullSecrets | indent 8 }}
Hyunsun Moon8da17882020-10-14 21:28:44 -050039 {{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070040 initContainers:
41 - name: mme-load-sctp-module
42 image: {{ .Values.images.tags.init | quote }}
43 imagePullPolicy: {{ .Values.images.pullPolicy }}
44 securityContext:
45 privileged: true
46 runAsUser: 0
Hyunsun Moonb0c8bcc2021-09-09 09:33:26 -070047 command: ["sh", "-xc"]
Jeremy Ronquillo223db002020-06-05 10:28:22 -070048 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
Hyunsun Moon83ff7352020-07-09 11:03:52 -070057 {{- if .Values.config.hss.deploy }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070058 - 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 []
Hyunsun Moon83ff7352020-07-09 11:03:52 -070087 {{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070088 - name: mme-init
89 image: {{ .Values.images.tags.mme | quote }}
90 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
Hyunsun Moon1fc24472021-03-14 19:10:11 -050099 mountPath: /opt/mme/scripts
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700100 - 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"
Ajay Lotan Thakur418dd5a2021-08-14 00:43:14 -0500130 {{- if .Values.config.managedByConfigPod.enabled }}
131 - name: MANAGED_BY_CONFIG_POD
132 value: "true"
133 {{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700134 volumeMounts:
135 - name: scripts
Hyunsun Moon1fc24472021-03-14 19:10:11 -0500136 mountPath: /opt/mme/scripts
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700137 - 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
148 image: {{ .Values.images.tags.mme | quote }}
149 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"
Ajay Lotan Thakur418dd5a2021-08-14 00:43:14 -0500165 {{- if .Values.config.managedByConfigPod.enabled }}
166 - name: MANAGED_BY_CONFIG_POD
167 value: "true"
168 {{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700169 volumeMounts:
170 - name: scripts
Hyunsun Moon1fc24472021-03-14 19:10:11 -0500171 mountPath: /opt/mme/scripts
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700172 - 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
183 image: {{ .Values.images.tags.mme | quote }}
184 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"
Ajay Lotan Thakur418dd5a2021-08-14 00:43:14 -0500200 {{- if .Values.config.managedByConfigPod.enabled }}
201 - name: MANAGED_BY_CONFIG_POD
202 value: "true"
203 {{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700204 volumeMounts:
205 - name: scripts
Hyunsun Moon1fc24472021-03-14 19:10:11 -0500206 mountPath: /opt/mme/scripts
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700207 - 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
216 image: {{ .Values.images.tags.mme | quote }}
217 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"
Ajay Lotan Thakur418dd5a2021-08-14 00:43:14 -0500233 {{- if .Values.config.managedByConfigPod.enabled }}
234 - name: MANAGED_BY_CONFIG_POD
235 value: "true"
236 {{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700237 volumeMounts:
238 - name: scripts
Hyunsun Moon1fc24472021-03-14 19:10:11 -0500239 mountPath: /opt/mme/scripts
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700240 - 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 }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700248 volumes:
249 - name: scripts
250 configMap:
Hyunsun Moon1fc24472021-03-14 19:10:11 -0500251 name: mme-scripts
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700252 defaultMode: 493
253 - name: configs
254 configMap:
Hyunsun Moon1fc24472021-03-14 19:10:11 -0500255 name: mme-configs
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700256 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 }}
Hyunsun Moon83ff7352020-07-09 11:03:52 -0700269{{- end }}