blob: c0b6e82ef535f528518704a51f2d31b58d3f1936 [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 Moon8da17882020-10-14 21:28:44 -050036 {{- if .Values.images.credentials }}
37 imagePullSecrets:
38 - name: {{ .Release.Name }}.registry
39 {{- 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
47 command: ["bash", "-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
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"
130 volumeMounts:
131 - name: scripts
Hyunsun Moon1fc24472021-03-14 19:10:11 -0500132 mountPath: /opt/mme/scripts
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700133 - name: shared-data
134 mountPath: /opt/mme/config/shared
135 - name: shared-app
136 mountPath: /tmp
137 - name: configs
138 mountPath: /opt/mme/config
139 {{- if .Values.config.coreDump.enabled }}
140 - name: coredump
141 mountPath: /tmp/coredump
142 {{- end }}
143 - name: s1ap-app
144 image: {{ .Values.images.tags.mme | quote }}
145 imagePullPolicy: {{ .Values.images.pullPolicy }}
146 {{- if .Values.config.coreDump.enabled }}
147 securityContext:
148 privileged: true
149 runAsUser: 0
150 {{- end }}
151 command: ["bash", "-xc"]
152 args:
153 - /opt/mme/scripts/mme-run.sh s1ap-app
154 {{- if .Values.resources.enabled }}
155 resources:
156{{ toYaml .Values.resources.mme | indent 10 }}
157 {{- end }}
158 env:
159 - name: MMERUNENV
160 value: "container"
161 volumeMounts:
162 - name: scripts
Hyunsun Moon1fc24472021-03-14 19:10:11 -0500163 mountPath: /opt/mme/scripts
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700164 - name: shared-data
165 mountPath: /opt/mme/config/shared
166 - name: shared-app
167 mountPath: /tmp
168 - name: configs
169 mountPath: /opt/mme/config
170 {{- if .Values.config.coreDump.enabled }}
171 - name: coredump
172 mountPath: /tmp/coredump
173 {{- end }}
174 - name: s6a-app
175 image: {{ .Values.images.tags.mme | quote }}
176 imagePullPolicy: {{ .Values.images.pullPolicy }}
177 {{- if .Values.config.coreDump.enabled }}
178 securityContext:
179 privileged: true
180 runAsUser: 0
181 {{- end }}
182 command: ["bash", "-xc"]
183 args:
184 - /opt/mme/scripts/mme-run.sh s6a-app
185 {{- if .Values.resources.enabled }}
186 resources:
187{{ toYaml .Values.resources.mme | indent 10 }}
188 {{- end }}
189 env:
190 - name: MMERUNENV
191 value: "container"
192 volumeMounts:
193 - name: scripts
Hyunsun Moon1fc24472021-03-14 19:10:11 -0500194 mountPath: /opt/mme/scripts
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700195 - name: shared-data
196 mountPath: /opt/mme/config/shared
197 - name: shared-app
198 mountPath: /tmp
199 {{- if .Values.config.coreDump.enabled }}
200 - name: coredump
201 mountPath: /tmp/coredump
202 {{- end }}
203 - name: s11-app
204 image: {{ .Values.images.tags.mme | quote }}
205 imagePullPolicy: {{ .Values.images.pullPolicy }}
206 {{- if .Values.config.coreDump.enabled }}
207 securityContext:
208 privileged: true
209 runAsUser: 0
210 {{- end }}
211 command: ["bash", "-xc"]
212 args:
213 - /opt/mme/scripts/mme-run.sh s11-app
214 {{- if .Values.resources.enabled }}
215 resources:
216{{ toYaml .Values.resources.mme | indent 10 }}
217 {{- end }}
218 env:
219 - name: MMERUNENV
220 value: "container"
221 volumeMounts:
222 - name: scripts
Hyunsun Moon1fc24472021-03-14 19:10:11 -0500223 mountPath: /opt/mme/scripts
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700224 - name: shared-data
225 mountPath: /opt/mme/config/shared
226 - name: shared-app
227 mountPath: /tmp
228 {{- if .Values.config.coreDump.enabled }}
229 - name: coredump
230 mountPath: /tmp/coredump
231 {{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700232 volumes:
233 - name: scripts
234 configMap:
Hyunsun Moon1fc24472021-03-14 19:10:11 -0500235 name: mme-scripts
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700236 defaultMode: 493
237 - name: configs
238 configMap:
Hyunsun Moon1fc24472021-03-14 19:10:11 -0500239 name: mme-configs
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700240 defaultMode: 420
241 - name: shared-data
242 emptyDir: {}
243 - name: shared-app
244 emptyDir: {}
245 - name: host-rootfs
246 hostPath:
247 path: /
248 {{- if .Values.config.coreDump.enabled }}
249 - name: coredump
250 hostPath:
251 path: {{ .Values.config.coreDump.path }}
252 {{- end }}
Hyunsun Moon83ff7352020-07-09 11:03:52 -0700253{{- end }}