blob: a858babf7d1f5a3f2d68e0bad06bee8789fd63be [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 Moon16d70922019-08-25 04:57:25 -050042 {{- if not (hasKey .Values.config.spgwc "mmeAddr") }}
43 - name: mme-configmap-mme-ip
44 image: {{ .Values.images.tags.init | quote }}
45 imagePullPolicy: {{ .Values.images.pullPolicy }}
46 env:
47 - name: NAMESPACE
48 valueFrom:
49 fieldRef:
50 apiVersion: v1
51 fieldPath: metadata.namespace
52 - name: POD_IP
53 valueFrom:
54 fieldRef:
55 fieldPath: status.podIP
56 command: ["/opt/mme/scripts/mme-ip.sh"]
57 volumeMounts:
58 - name: scripts
59 mountPath: /opt/mme/scripts/mme-ip.sh
60 subPath: mme-ip.sh
61 {{- end }}
Hyunsun Moonece86982019-09-27 17:44:59 -050062 - name: mme-load-sctp-module
63 image: {{ .Values.images.tags.init | quote }}
64 imagePullPolicy: {{ .Values.images.pullPolicy }}
65 securityContext:
66 privileged: true
67 runAsUser: 0
68 command: ["bash", "-xc"]
69 args:
70 - >
71 if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \
72 chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \
Hyunsun Moonec0b44d2020-01-10 15:50:53 -070073 fi;
Hyunsun Moonece86982019-09-27 17:44:59 -050074 volumeMounts:
75 - name: host-rootfs
76 mountPath: /mnt/host-rootfs
Hyunsun Moon636e17d2019-07-03 12:52:15 -050077 - name: mme-dep-check
Hyunsun Moon06f98552019-08-15 13:44:47 -060078 image: {{ .Values.images.tags.depCheck | quote }}
79 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050080 securityContext:
81 allowPrivilegeEscalation: false
82 readOnlyRootFilesystem: false
83 runAsUser: 0
84 env:
85 - name: POD_NAME
86 valueFrom:
87 fieldRef:
88 apiVersion: v1
89 fieldPath: metadata.name
90 - name: NAMESPACE
91 valueFrom:
92 fieldRef:
93 apiVersion: v1
94 fieldPath: metadata.namespace
95 - name: PATH
96 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
97 - name: COMMAND
98 value: "echo done"
99 - name: DEPENDENCY_POD_JSON
Hyunsun Moon16d70922019-08-25 04:57:25 -0500100 value: '[{"labels": {"app": "hss"}, "requireSameNode": false}]'
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500101 # add dependency job for make_certs.sh
102 command:
103 - kubernetes-entrypoint
104 volumeMounts:
105 []
106 - name: mme-init
Hyunsun Moon06f98552019-08-15 13:44:47 -0600107 image: {{ .Values.images.tags.mme | quote }}
108 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500109 command: ["/opt/mme/scripts/mme-init.sh"]
110 env:
Hyunsun Moon16d70922019-08-25 04:57:25 -0500111 - name: POD_IP
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500112 valueFrom:
113 fieldRef:
114 fieldPath: status.podIP
115 volumeMounts:
116 - name: scripts
117 mountPath: /opt/mme/scripts/mme-init.sh
118 subPath: mme-init.sh
119 - name: configs
120 mountPath: /opt/mme/config
121 - name: shared-data
122 mountPath: /opt/mme/config/shared
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700123 {{- if .Values.config.coreDump.enabled }}
124{{ tuple "mme" . | include "omec-control-plane.coredump_init" | indent 6 }}
125 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500126 containers:
127 - name: mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600128 image: {{ .Values.images.tags.mme | quote }}
129 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700130 {{- if .Values.config.coreDump.enabled }}
131 securityContext:
132 privileged: true
133 runAsUser: 0
134 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500135 command: ["bash", "-xc"]
136 args:
137 - /opt/mme/scripts/mme-run.sh mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600138 {{- if .Values.resources.enabled }}
139 resources:
140{{ toYaml .Values.resources.mme | indent 10 }}
141 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500142 volumeMounts:
143 - name: scripts
144 mountPath: /opt/mme/scripts/mme-run.sh
145 subPath: mme-run.sh
146 - name: shared-data
147 mountPath: /opt/mme/config/shared
148 - name: shared-app
149 mountPath: /tmp
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700150 - name: configs
151 mountPath: /opt/mme/config
152 {{- if .Values.config.coreDump.enabled }}
153 - name: coredump
154 mountPath: /tmp/coredump
155 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500156 - name: s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600157 image: {{ .Values.images.tags.mme | quote }}
158 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700159 {{- if .Values.config.coreDump.enabled }}
160 securityContext:
161 privileged: true
162 runAsUser: 0
163 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500164 command: ["bash", "-xc"]
165 args:
166 - /opt/mme/scripts/mme-run.sh s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600167 {{- if .Values.resources.enabled }}
168 resources:
169{{ toYaml .Values.resources.mme | indent 10 }}
170 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500171 volumeMounts:
172 - name: scripts
173 mountPath: /opt/mme/scripts/mme-run.sh
174 subPath: mme-run.sh
175 - name: shared-data
176 mountPath: /opt/mme/config/shared
177 - name: shared-app
178 mountPath: /tmp
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700179 {{- if .Values.config.coreDump.enabled }}
180 - name: coredump
181 mountPath: /tmp/coredump
182 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500183 - name: s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600184 image: {{ .Values.images.tags.mme | quote }}
185 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700186 {{- if .Values.config.coreDump.enabled }}
187 securityContext:
188 privileged: true
189 runAsUser: 0
190 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500191 command: ["bash", "-xc"]
192 args:
193 - /opt/mme/scripts/mme-run.sh s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600194 {{- if .Values.resources.enabled }}
195 resources:
196{{ toYaml .Values.resources.mme | indent 10 }}
197 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500198 volumeMounts:
199 - name: scripts
200 mountPath: /opt/mme/scripts/mme-run.sh
201 subPath: mme-run.sh
202 - name: shared-data
203 mountPath: /opt/mme/config/shared
204 - name: shared-app
205 mountPath: /tmp
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700206 {{- if .Values.config.coreDump.enabled }}
207 - name: coredump
208 mountPath: /tmp/coredump
209 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500210 - name: s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600211 image: {{ .Values.images.tags.mme | quote }}
212 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700213 {{- if .Values.config.coreDump.enabled }}
214 securityContext:
215 privileged: true
216 runAsUser: 0
217 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500218 command: ["bash", "-xc"]
219 args:
220 - /opt/mme/scripts/mme-run.sh s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600221 {{- if .Values.resources.enabled }}
222 resources:
223{{ toYaml .Values.resources.mme | indent 10 }}
224 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500225 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
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700233 {{- if .Values.config.coreDump.enabled }}
234 - name: coredump
235 mountPath: /tmp/coredump
236 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500237 volumes:
238 - name: scripts
239 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600240 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500241 defaultMode: 493
242 - name: configs
243 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600244 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500245 defaultMode: 420
246 - name: shared-data
247 emptyDir: {}
248 - name: shared-app
249 emptyDir: {}
Hyunsun Moonece86982019-09-27 17:44:59 -0500250 - name: host-rootfs
251 hostPath:
252 path: /
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700253 {{- if .Values.config.coreDump.enabled }}
254 - name: coredump
255 hostPath:
256 path: {{ .Values.config.coreDump.path }}
257 {{- end }}