blob: f0e729087e6391a0175c69bdf66210819dc4977b [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
27 selector:
28 matchLabels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060029{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 6 }}
Hyunsun Mooned24cac2019-08-26 20:52:20 -050030 serviceName: mme
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; \
73 fi
74 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
123 containers:
124 - name: mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600125 image: {{ .Values.images.tags.mme | quote }}
126 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500127 command: ["bash", "-xc"]
128 args:
129 - /opt/mme/scripts/mme-run.sh mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600130 {{- if .Values.resources.enabled }}
131 resources:
132{{ toYaml .Values.resources.mme | indent 10 }}
133 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500134 volumeMounts:
135 - name: scripts
136 mountPath: /opt/mme/scripts/mme-run.sh
137 subPath: mme-run.sh
138 - name: shared-data
139 mountPath: /opt/mme/config/shared
140 - name: shared-app
141 mountPath: /tmp
142 - name: s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600143 image: {{ .Values.images.tags.mme | quote }}
144 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500145 command: ["bash", "-xc"]
146 args:
147 - /opt/mme/scripts/mme-run.sh s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600148 {{- if .Values.resources.enabled }}
149 resources:
150{{ toYaml .Values.resources.mme | indent 10 }}
151 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500152 volumeMounts:
153 - name: scripts
154 mountPath: /opt/mme/scripts/mme-run.sh
155 subPath: mme-run.sh
156 - name: shared-data
157 mountPath: /opt/mme/config/shared
158 - name: shared-app
159 mountPath: /tmp
160 - name: s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600161 image: {{ .Values.images.tags.mme | quote }}
162 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500163 command: ["bash", "-xc"]
164 args:
165 - /opt/mme/scripts/mme-run.sh s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600166 {{- if .Values.resources.enabled }}
167 resources:
168{{ toYaml .Values.resources.mme | indent 10 }}
169 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500170 volumeMounts:
171 - name: scripts
172 mountPath: /opt/mme/scripts/mme-run.sh
173 subPath: mme-run.sh
174 - name: shared-data
175 mountPath: /opt/mme/config/shared
176 - name: shared-app
177 mountPath: /tmp
178 - name: s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600179 image: {{ .Values.images.tags.mme | quote }}
180 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500181 command: ["bash", "-xc"]
182 args:
183 - /opt/mme/scripts/mme-run.sh s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600184 {{- if .Values.resources.enabled }}
185 resources:
186{{ toYaml .Values.resources.mme | indent 10 }}
187 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500188 volumeMounts:
189 - name: scripts
190 mountPath: /opt/mme/scripts/mme-run.sh
191 subPath: mme-run.sh
192 - name: shared-data
193 mountPath: /opt/mme/config/shared
194 - name: shared-app
195 mountPath: /tmp
196 volumes:
197 - name: scripts
198 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600199 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500200 defaultMode: 493
201 - name: configs
202 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600203 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500204 defaultMode: 420
205 - name: shared-data
206 emptyDir: {}
207 - name: shared-app
208 emptyDir: {}
Hyunsun Moonece86982019-09-27 17:44:59 -0500209 - name: host-rootfs
210 hostPath:
211 path: /