blob: fbaf094c58f4d88636b8ce66b1e887603ff7b6f3 [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 Moon636e17d2019-07-03 12:52:15 -050030 template:
31 metadata:
32 labels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060033{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 8 }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050034 spec:
Hyunsun Moon06f98552019-08-15 13:44:47 -060035 {{- if .Values.nodeSelectors.enabled }}
36 nodeSelector:
37 {{ .Values.nodeSelectors.mme.label }}: {{ .Values.nodeSelectors.mme.value }}
38 {{- end }}
39 serviceAccountName: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -050040 initContainers:
Hyunsun Moon16d70922019-08-25 04:57:25 -050041 {{- if not (hasKey .Values.config.spgwc "mmeAddr") }}
42 - name: mme-configmap-mme-ip
43 image: {{ .Values.images.tags.init | quote }}
44 imagePullPolicy: {{ .Values.images.pullPolicy }}
45 env:
46 - name: NAMESPACE
47 valueFrom:
48 fieldRef:
49 apiVersion: v1
50 fieldPath: metadata.namespace
51 - name: POD_IP
52 valueFrom:
53 fieldRef:
54 fieldPath: status.podIP
55 command: ["/opt/mme/scripts/mme-ip.sh"]
56 volumeMounts:
57 - name: scripts
58 mountPath: /opt/mme/scripts/mme-ip.sh
59 subPath: mme-ip.sh
60 {{- end }}
Hyunsun Moonece86982019-09-27 17:44:59 -050061 - name: mme-load-sctp-module
62 image: {{ .Values.images.tags.init | quote }}
63 imagePullPolicy: {{ .Values.images.pullPolicy }}
64 securityContext:
65 privileged: true
66 runAsUser: 0
67 command: ["bash", "-xc"]
68 args:
69 - >
70 if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \
71 chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \
72 fi
73 volumeMounts:
74 - name: host-rootfs
75 mountPath: /mnt/host-rootfs
Hyunsun Moon636e17d2019-07-03 12:52:15 -050076 - name: mme-dep-check
Hyunsun Moon06f98552019-08-15 13:44:47 -060077 image: {{ .Values.images.tags.depCheck | quote }}
78 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050079 securityContext:
80 allowPrivilegeEscalation: false
81 readOnlyRootFilesystem: false
82 runAsUser: 0
83 env:
84 - name: POD_NAME
85 valueFrom:
86 fieldRef:
87 apiVersion: v1
88 fieldPath: metadata.name
89 - name: NAMESPACE
90 valueFrom:
91 fieldRef:
92 apiVersion: v1
93 fieldPath: metadata.namespace
94 - name: PATH
95 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
96 - name: COMMAND
97 value: "echo done"
98 - name: DEPENDENCY_POD_JSON
Hyunsun Moon16d70922019-08-25 04:57:25 -050099 value: '[{"labels": {"app": "hss"}, "requireSameNode": false}]'
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500100 # add dependency job for make_certs.sh
101 command:
102 - kubernetes-entrypoint
103 volumeMounts:
104 []
105 - name: mme-init
Hyunsun Moon06f98552019-08-15 13:44:47 -0600106 image: {{ .Values.images.tags.mme | quote }}
107 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500108 command: ["/opt/mme/scripts/mme-init.sh"]
109 env:
Hyunsun Moon16d70922019-08-25 04:57:25 -0500110 - name: POD_IP
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500111 valueFrom:
112 fieldRef:
113 fieldPath: status.podIP
114 volumeMounts:
115 - name: scripts
116 mountPath: /opt/mme/scripts/mme-init.sh
117 subPath: mme-init.sh
118 - name: configs
119 mountPath: /opt/mme/config
120 - name: shared-data
121 mountPath: /opt/mme/config/shared
122 containers:
123 - name: mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600124 image: {{ .Values.images.tags.mme | quote }}
125 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500126 command: ["bash", "-xc"]
127 args:
128 - /opt/mme/scripts/mme-run.sh mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600129 {{- if .Values.resources.enabled }}
130 resources:
131{{ toYaml .Values.resources.mme | indent 10 }}
132 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500133 volumeMounts:
134 - name: scripts
135 mountPath: /opt/mme/scripts/mme-run.sh
136 subPath: mme-run.sh
137 - name: shared-data
138 mountPath: /opt/mme/config/shared
139 - name: shared-app
140 mountPath: /tmp
141 - name: s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600142 image: {{ .Values.images.tags.mme | quote }}
143 imagePullPolicy: {{ .Values.images.pullPolicy }}
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
159 - name: s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600160 image: {{ .Values.images.tags.mme | quote }}
161 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500162 command: ["bash", "-xc"]
163 args:
164 - /opt/mme/scripts/mme-run.sh s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600165 {{- if .Values.resources.enabled }}
166 resources:
167{{ toYaml .Values.resources.mme | indent 10 }}
168 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500169 volumeMounts:
170 - name: scripts
171 mountPath: /opt/mme/scripts/mme-run.sh
172 subPath: mme-run.sh
173 - name: shared-data
174 mountPath: /opt/mme/config/shared
175 - name: shared-app
176 mountPath: /tmp
177 - name: s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600178 image: {{ .Values.images.tags.mme | quote }}
179 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500180 command: ["bash", "-xc"]
181 args:
182 - /opt/mme/scripts/mme-run.sh s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600183 {{- if .Values.resources.enabled }}
184 resources:
185{{ toYaml .Values.resources.mme | indent 10 }}
186 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500187 volumeMounts:
188 - name: scripts
189 mountPath: /opt/mme/scripts/mme-run.sh
190 subPath: mme-run.sh
191 - name: shared-data
192 mountPath: /opt/mme/config/shared
193 - name: shared-app
194 mountPath: /tmp
195 volumes:
196 - name: scripts
197 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600198 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500199 defaultMode: 493
200 - name: configs
201 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600202 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500203 defaultMode: 420
204 - name: shared-data
205 emptyDir: {}
206 - name: shared-app
207 emptyDir: {}
Hyunsun Moonece86982019-09-27 17:44:59 -0500208 - name: host-rootfs
209 hostPath:
210 path: /