blob: c0c180c02d18a0f28dc4f1fea8b6092df4d2e265 [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
99 mountPath: /opt/mme/scripts/mme-init.sh
100 subPath: mme-init.sh
101 - name: configs
102 mountPath: /opt/mme/config
103 - name: shared-data
104 mountPath: /opt/mme/config/shared
105 {{- if .Values.config.coreDump.enabled }}
106{{ tuple "mme" . | include "omec-control-plane.coredump_init" | indent 6 }}
107 {{- end }}
108 containers:
109 - name: mme-app
110 image: {{ .Values.images.tags.mme | quote }}
111 imagePullPolicy: {{ .Values.images.pullPolicy }}
112 {{- if .Values.config.coreDump.enabled }}
113 securityContext:
114 privileged: true
115 runAsUser: 0
116 {{- end }}
117 command: ["bash", "-xc"]
118 args:
119 - /opt/mme/scripts/mme-run.sh mme-app
120 {{- if .Values.resources.enabled }}
121 resources:
122{{ toYaml .Values.resources.mme | indent 10 }}
123 {{- end }}
124 env:
125 - name: POD_IP
126 valueFrom:
127 fieldRef:
128 fieldPath: status.podIP
129 - name: MMERUNENV
130 value: "container"
131 volumeMounts:
132 - name: scripts
133 mountPath: /opt/mme/scripts/mme-run.sh
134 subPath: mme-run.sh
135 - name: shared-data
136 mountPath: /opt/mme/config/shared
137 - name: shared-app
138 mountPath: /tmp
139 - name: configs
140 mountPath: /opt/mme/config
141 {{- if .Values.config.coreDump.enabled }}
142 - name: coredump
143 mountPath: /tmp/coredump
144 {{- end }}
145 - name: s1ap-app
146 image: {{ .Values.images.tags.mme | quote }}
147 imagePullPolicy: {{ .Values.images.pullPolicy }}
148 {{- if .Values.config.coreDump.enabled }}
149 securityContext:
150 privileged: true
151 runAsUser: 0
152 {{- end }}
153 command: ["bash", "-xc"]
154 args:
155 - /opt/mme/scripts/mme-run.sh s1ap-app
156 {{- if .Values.resources.enabled }}
157 resources:
158{{ toYaml .Values.resources.mme | indent 10 }}
159 {{- end }}
160 env:
161 - name: MMERUNENV
162 value: "container"
163 volumeMounts:
164 - name: scripts
165 mountPath: /opt/mme/scripts/mme-run.sh
166 subPath: mme-run.sh
167 - name: shared-data
168 mountPath: /opt/mme/config/shared
169 - name: shared-app
170 mountPath: /tmp
171 - name: configs
172 mountPath: /opt/mme/config
173 {{- if .Values.config.coreDump.enabled }}
174 - name: coredump
175 mountPath: /tmp/coredump
176 {{- end }}
177 - name: s6a-app
178 image: {{ .Values.images.tags.mme | quote }}
179 imagePullPolicy: {{ .Values.images.pullPolicy }}
180 {{- if .Values.config.coreDump.enabled }}
181 securityContext:
182 privileged: true
183 runAsUser: 0
184 {{- end }}
185 command: ["bash", "-xc"]
186 args:
187 - /opt/mme/scripts/mme-run.sh s6a-app
188 {{- if .Values.resources.enabled }}
189 resources:
190{{ toYaml .Values.resources.mme | indent 10 }}
191 {{- end }}
192 env:
193 - name: MMERUNENV
194 value: "container"
195 volumeMounts:
196 - name: scripts
197 mountPath: /opt/mme/scripts/mme-run.sh
198 subPath: mme-run.sh
199 - name: shared-data
200 mountPath: /opt/mme/config/shared
201 - name: shared-app
202 mountPath: /tmp
203 {{- if .Values.config.coreDump.enabled }}
204 - name: coredump
205 mountPath: /tmp/coredump
206 {{- end }}
207 - name: s11-app
208 image: {{ .Values.images.tags.mme | quote }}
209 imagePullPolicy: {{ .Values.images.pullPolicy }}
210 {{- if .Values.config.coreDump.enabled }}
211 securityContext:
212 privileged: true
213 runAsUser: 0
214 {{- end }}
215 command: ["bash", "-xc"]
216 args:
217 - /opt/mme/scripts/mme-run.sh s11-app
218 {{- if .Values.resources.enabled }}
219 resources:
220{{ toYaml .Values.resources.mme | indent 10 }}
221 {{- end }}
222 env:
223 - name: MMERUNENV
224 value: "container"
225 volumeMounts:
226 - name: scripts
227 mountPath: /opt/mme/scripts/mme-run.sh
228 subPath: mme-run.sh
229 - name: shared-data
230 mountPath: /opt/mme/config/shared
231 - name: shared-app
232 mountPath: /tmp
233 {{- if .Values.config.coreDump.enabled }}
234 - name: coredump
235 mountPath: /tmp/coredump
236 {{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700237 volumes:
238 - name: scripts
239 configMap:
240 name: mme
241 defaultMode: 493
242 - name: configs
243 configMap:
244 name: mme
245 defaultMode: 420
246 - name: shared-data
247 emptyDir: {}
248 - name: shared-app
249 emptyDir: {}
250 - name: host-rootfs
251 hostPath:
252 path: /
253 {{- if .Values.config.coreDump.enabled }}
254 - name: coredump
255 hostPath:
256 path: {{ .Values.config.coreDump.path }}
257 {{- end }}
Hyunsun Moon83ff7352020-07-09 11:03:52 -0700258{{- end }}