blob: bb8b3c6bb76d0ece3849d36eedb731a402c798b6 [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
Ajay Lotan Thakurff2cad62019-12-01 04:41:58 -0800139 - name: configs
140 mountPath: /opt/mme/config
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500141 - name: shared-app
142 mountPath: /tmp
143 - name: s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600144 image: {{ .Values.images.tags.mme | quote }}
145 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500146 command: ["bash", "-xc"]
147 args:
148 - /opt/mme/scripts/mme-run.sh s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600149 {{- if .Values.resources.enabled }}
150 resources:
151{{ toYaml .Values.resources.mme | indent 10 }}
152 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500153 volumeMounts:
154 - name: scripts
155 mountPath: /opt/mme/scripts/mme-run.sh
156 subPath: mme-run.sh
157 - name: shared-data
158 mountPath: /opt/mme/config/shared
159 - name: shared-app
160 mountPath: /tmp
161 - name: s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600162 image: {{ .Values.images.tags.mme | quote }}
163 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500164 command: ["bash", "-xc"]
165 args:
166 - /opt/mme/scripts/mme-run.sh s6a-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
179 - name: s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600180 image: {{ .Values.images.tags.mme | quote }}
181 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500182 command: ["bash", "-xc"]
183 args:
184 - /opt/mme/scripts/mme-run.sh s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600185 {{- if .Values.resources.enabled }}
186 resources:
187{{ toYaml .Values.resources.mme | indent 10 }}
188 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500189 volumeMounts:
190 - name: scripts
191 mountPath: /opt/mme/scripts/mme-run.sh
192 subPath: mme-run.sh
193 - name: shared-data
194 mountPath: /opt/mme/config/shared
195 - name: shared-app
196 mountPath: /tmp
197 volumes:
198 - name: scripts
199 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600200 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500201 defaultMode: 493
202 - name: configs
203 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600204 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500205 defaultMode: 420
206 - name: shared-data
207 emptyDir: {}
208 - name: shared-app
209 emptyDir: {}
Hyunsun Moonece86982019-09-27 17:44:59 -0500210 - name: host-rootfs
211 hostPath:
212 path: /