blob: 2ea0afef5b803bc8238803b29f414090604a6d24 [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 Moonece86982019-09-27 17:44:59 -050042 - name: mme-load-sctp-module
43 image: {{ .Values.images.tags.init | quote }}
44 imagePullPolicy: {{ .Values.images.pullPolicy }}
45 securityContext:
46 privileged: true
47 runAsUser: 0
48 command: ["bash", "-xc"]
49 args:
50 - >
51 if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \
52 chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \
Hyunsun Moonec0b44d2020-01-10 15:50:53 -070053 fi;
Hyunsun Moonece86982019-09-27 17:44:59 -050054 volumeMounts:
55 - name: host-rootfs
56 mountPath: /mnt/host-rootfs
Hyunsun Moon636e17d2019-07-03 12:52:15 -050057 - name: mme-dep-check
Hyunsun Moon06f98552019-08-15 13:44:47 -060058 image: {{ .Values.images.tags.depCheck | quote }}
59 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050060 securityContext:
61 allowPrivilegeEscalation: false
62 readOnlyRootFilesystem: false
63 runAsUser: 0
64 env:
65 - name: POD_NAME
66 valueFrom:
67 fieldRef:
68 apiVersion: v1
69 fieldPath: metadata.name
70 - name: NAMESPACE
71 valueFrom:
72 fieldRef:
73 apiVersion: v1
74 fieldPath: metadata.namespace
75 - name: PATH
76 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
77 - name: COMMAND
78 value: "echo done"
79 - name: DEPENDENCY_POD_JSON
Hyunsun Moon16d70922019-08-25 04:57:25 -050080 value: '[{"labels": {"app": "hss"}, "requireSameNode": false}]'
Hyunsun Moon636e17d2019-07-03 12:52:15 -050081 # add dependency job for make_certs.sh
82 command:
83 - kubernetes-entrypoint
84 volumeMounts:
85 []
86 - name: mme-init
Hyunsun Moon06f98552019-08-15 13:44:47 -060087 image: {{ .Values.images.tags.mme | quote }}
88 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050089 command: ["/opt/mme/scripts/mme-init.sh"]
90 env:
Hyunsun Moon16d70922019-08-25 04:57:25 -050091 - name: POD_IP
Hyunsun Moon636e17d2019-07-03 12:52:15 -050092 valueFrom:
93 fieldRef:
94 fieldPath: status.podIP
95 volumeMounts:
96 - name: scripts
97 mountPath: /opt/mme/scripts/mme-init.sh
98 subPath: mme-init.sh
99 - name: configs
100 mountPath: /opt/mme/config
101 - name: shared-data
102 mountPath: /opt/mme/config/shared
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700103 {{- if .Values.config.coreDump.enabled }}
104{{ tuple "mme" . | include "omec-control-plane.coredump_init" | indent 6 }}
105 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500106 containers:
107 - name: mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600108 image: {{ .Values.images.tags.mme | quote }}
109 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700110 {{- if .Values.config.coreDump.enabled }}
111 securityContext:
112 privileged: true
113 runAsUser: 0
114 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500115 command: ["bash", "-xc"]
116 args:
117 - /opt/mme/scripts/mme-run.sh mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600118 {{- if .Values.resources.enabled }}
119 resources:
120{{ toYaml .Values.resources.mme | indent 10 }}
121 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500122 volumeMounts:
123 - name: scripts
124 mountPath: /opt/mme/scripts/mme-run.sh
125 subPath: mme-run.sh
126 - name: shared-data
127 mountPath: /opt/mme/config/shared
128 - name: shared-app
129 mountPath: /tmp
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700130 - name: configs
131 mountPath: /opt/mme/config
132 {{- if .Values.config.coreDump.enabled }}
133 - name: coredump
134 mountPath: /tmp/coredump
135 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500136 - name: s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600137 image: {{ .Values.images.tags.mme | quote }}
138 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700139 {{- if .Values.config.coreDump.enabled }}
140 securityContext:
141 privileged: true
142 runAsUser: 0
143 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500144 command: ["bash", "-xc"]
145 args:
146 - /opt/mme/scripts/mme-run.sh s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600147 {{- if .Values.resources.enabled }}
148 resources:
149{{ toYaml .Values.resources.mme | indent 10 }}
150 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500151 volumeMounts:
152 - name: scripts
153 mountPath: /opt/mme/scripts/mme-run.sh
154 subPath: mme-run.sh
155 - name: shared-data
156 mountPath: /opt/mme/config/shared
157 - name: shared-app
158 mountPath: /tmp
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700159 {{- if .Values.config.coreDump.enabled }}
160 - name: coredump
161 mountPath: /tmp/coredump
162 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500163 - name: s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600164 image: {{ .Values.images.tags.mme | quote }}
165 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700166 {{- if .Values.config.coreDump.enabled }}
167 securityContext:
168 privileged: true
169 runAsUser: 0
170 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500171 command: ["bash", "-xc"]
172 args:
173 - /opt/mme/scripts/mme-run.sh s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600174 {{- if .Values.resources.enabled }}
175 resources:
176{{ toYaml .Values.resources.mme | indent 10 }}
177 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500178 volumeMounts:
179 - name: scripts
180 mountPath: /opt/mme/scripts/mme-run.sh
181 subPath: mme-run.sh
182 - name: shared-data
183 mountPath: /opt/mme/config/shared
184 - name: shared-app
185 mountPath: /tmp
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700186 {{- if .Values.config.coreDump.enabled }}
187 - name: coredump
188 mountPath: /tmp/coredump
189 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500190 - name: s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600191 image: {{ .Values.images.tags.mme | quote }}
192 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700193 {{- if .Values.config.coreDump.enabled }}
194 securityContext:
195 privileged: true
196 runAsUser: 0
197 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500198 command: ["bash", "-xc"]
199 args:
200 - /opt/mme/scripts/mme-run.sh s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600201 {{- if .Values.resources.enabled }}
202 resources:
203{{ toYaml .Values.resources.mme | indent 10 }}
204 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500205 volumeMounts:
206 - name: scripts
207 mountPath: /opt/mme/scripts/mme-run.sh
208 subPath: mme-run.sh
209 - name: shared-data
210 mountPath: /opt/mme/config/shared
211 - name: shared-app
212 mountPath: /tmp
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700213 {{- if .Values.config.coreDump.enabled }}
214 - name: coredump
215 mountPath: /tmp/coredump
216 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500217 volumes:
218 - name: scripts
219 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600220 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500221 defaultMode: 493
222 - name: configs
223 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600224 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500225 defaultMode: 420
226 - name: shared-data
227 emptyDir: {}
228 - name: shared-app
229 emptyDir: {}
Hyunsun Moonece86982019-09-27 17:44:59 -0500230 - name: host-rootfs
231 hostPath:
232 path: /
Hyunsun Moonec0b44d2020-01-10 15:50:53 -0700233 {{- if .Values.config.coreDump.enabled }}
234 - name: coredump
235 hostPath:
236 path: {{ .Values.config.coreDump.path }}
237 {{- end }}