blob: 8dd2ea36ea60c1d6f6689187f6b4969ce4e351d2 [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
36 initContainers:
37 - name: mme-load-sctp-module
38 image: {{ .Values.images.tags.init | quote }}
39 imagePullPolicy: {{ .Values.images.pullPolicy }}
40 securityContext:
41 privileged: true
42 runAsUser: 0
43 command: ["bash", "-xc"]
44 args:
45 - |
46 if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \
47 chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \
48 fi;
49 chroot /mnt/host-rootfs modprobe tipc
50 volumeMounts:
51 - name: host-rootfs
52 mountPath: /mnt/host-rootfs
Hyunsun Moon83ff7352020-07-09 11:03:52 -070053 {{- if .Values.config.hss.deploy }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070054 - name: mme-dep-check
55 image: {{ .Values.images.tags.depCheck | quote }}
56 imagePullPolicy: {{ .Values.images.pullPolicy }}
57 securityContext:
58 allowPrivilegeEscalation: false
59 readOnlyRootFilesystem: false
60 runAsUser: 0
61 env:
62 - name: POD_NAME
63 valueFrom:
64 fieldRef:
65 apiVersion: v1
66 fieldPath: metadata.name
67 - name: NAMESPACE
68 valueFrom:
69 fieldRef:
70 apiVersion: v1
71 fieldPath: metadata.namespace
72 - name: PATH
73 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
74 - name: COMMAND
75 value: "echo done"
76 - name: DEPENDENCY_POD_JSON
77 value: '[{"labels": {"app": "hss"}, "requireSameNode": false}]'
78 # add dependency job for make_certs.sh
79 command:
80 - kubernetes-entrypoint
81 volumeMounts:
82 []
Hyunsun Moon83ff7352020-07-09 11:03:52 -070083 {{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070084 - name: mme-init
85 image: {{ .Values.images.tags.mme | quote }}
86 imagePullPolicy: {{ .Values.images.pullPolicy }}
87 command: ["/opt/mme/scripts/mme-init.sh"]
88 env:
89 - name: POD_IP
90 valueFrom:
91 fieldRef:
92 fieldPath: status.podIP
93 volumeMounts:
94 - name: scripts
95 mountPath: /opt/mme/scripts/mme-init.sh
96 subPath: mme-init.sh
97 - name: configs
98 mountPath: /opt/mme/config
99 - name: shared-data
100 mountPath: /opt/mme/config/shared
101 {{- if .Values.config.coreDump.enabled }}
102{{ tuple "mme" . | include "omec-control-plane.coredump_init" | indent 6 }}
103 {{- end }}
104 containers:
105 - name: mme-app
106 image: {{ .Values.images.tags.mme | quote }}
107 imagePullPolicy: {{ .Values.images.pullPolicy }}
108 {{- if .Values.config.coreDump.enabled }}
109 securityContext:
110 privileged: true
111 runAsUser: 0
112 {{- end }}
113 command: ["bash", "-xc"]
114 args:
115 - /opt/mme/scripts/mme-run.sh mme-app
116 {{- if .Values.resources.enabled }}
117 resources:
118{{ toYaml .Values.resources.mme | indent 10 }}
119 {{- end }}
120 env:
121 - name: POD_IP
122 valueFrom:
123 fieldRef:
124 fieldPath: status.podIP
125 - name: MMERUNENV
126 value: "container"
127 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
135 - name: configs
136 mountPath: /opt/mme/config
137 {{- if .Values.config.coreDump.enabled }}
138 - name: coredump
139 mountPath: /tmp/coredump
140 {{- end }}
141 - name: s1ap-app
142 image: {{ .Values.images.tags.mme | quote }}
143 imagePullPolicy: {{ .Values.images.pullPolicy }}
144 {{- if .Values.config.coreDump.enabled }}
145 securityContext:
146 privileged: true
147 runAsUser: 0
148 {{- end }}
149 command: ["bash", "-xc"]
150 args:
151 - /opt/mme/scripts/mme-run.sh s1ap-app
152 {{- if .Values.resources.enabled }}
153 resources:
154{{ toYaml .Values.resources.mme | indent 10 }}
155 {{- end }}
156 env:
157 - name: MMERUNENV
158 value: "container"
159 volumeMounts:
160 - name: scripts
161 mountPath: /opt/mme/scripts/mme-run.sh
162 subPath: mme-run.sh
163 - name: shared-data
164 mountPath: /opt/mme/config/shared
165 - name: shared-app
166 mountPath: /tmp
167 - name: configs
168 mountPath: /opt/mme/config
169 {{- if .Values.config.coreDump.enabled }}
170 - name: coredump
171 mountPath: /tmp/coredump
172 {{- end }}
173 - name: s6a-app
174 image: {{ .Values.images.tags.mme | quote }}
175 imagePullPolicy: {{ .Values.images.pullPolicy }}
176 {{- if .Values.config.coreDump.enabled }}
177 securityContext:
178 privileged: true
179 runAsUser: 0
180 {{- end }}
181 command: ["bash", "-xc"]
182 args:
183 - /opt/mme/scripts/mme-run.sh s6a-app
184 {{- if .Values.resources.enabled }}
185 resources:
186{{ toYaml .Values.resources.mme | indent 10 }}
187 {{- end }}
188 env:
189 - name: MMERUNENV
190 value: "container"
191 volumeMounts:
192 - name: scripts
193 mountPath: /opt/mme/scripts/mme-run.sh
194 subPath: mme-run.sh
195 - 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
223 mountPath: /opt/mme/scripts/mme-run.sh
224 subPath: mme-run.sh
225 - name: shared-data
226 mountPath: /opt/mme/config/shared
227 - name: shared-app
228 mountPath: /tmp
229 {{- if .Values.config.coreDump.enabled }}
230 - name: coredump
231 mountPath: /tmp/coredump
232 {{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -0700233 volumes:
234 - name: scripts
235 configMap:
236 name: mme
237 defaultMode: 493
238 - name: configs
239 configMap:
240 name: mme
241 defaultMode: 420
242 - name: shared-data
243 emptyDir: {}
244 - name: shared-app
245 emptyDir: {}
246 - name: host-rootfs
247 hostPath:
248 path: /
249 {{- if .Values.config.coreDump.enabled }}
250 - name: coredump
251 hostPath:
252 path: {{ .Values.config.coreDump.path }}
253 {{- end }}
Hyunsun Moon83ff7352020-07-09 11:03:52 -0700254{{- end }}