blob: ff64007f91c7be7943912db9be00e12f51b7e3be [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; \
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
Ajay Lotan Thakurff2cad62019-12-01 04:41:58 -0800140 - name: configs
141 mountPath: /opt/mme/config
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500142 - name: shared-app
143 mountPath: /tmp
144 - name: s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600145 image: {{ .Values.images.tags.mme | quote }}
146 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500147 command: ["bash", "-xc"]
148 args:
149 - /opt/mme/scripts/mme-run.sh s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600150 {{- if .Values.resources.enabled }}
151 resources:
152{{ toYaml .Values.resources.mme | indent 10 }}
153 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500154 volumeMounts:
155 - name: scripts
156 mountPath: /opt/mme/scripts/mme-run.sh
157 subPath: mme-run.sh
158 - name: shared-data
159 mountPath: /opt/mme/config/shared
160 - name: shared-app
161 mountPath: /tmp
162 - name: s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600163 image: {{ .Values.images.tags.mme | quote }}
164 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500165 command: ["bash", "-xc"]
166 args:
167 - /opt/mme/scripts/mme-run.sh s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600168 {{- if .Values.resources.enabled }}
169 resources:
170{{ toYaml .Values.resources.mme | indent 10 }}
171 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500172 volumeMounts:
173 - name: scripts
174 mountPath: /opt/mme/scripts/mme-run.sh
175 subPath: mme-run.sh
176 - name: shared-data
177 mountPath: /opt/mme/config/shared
178 - name: shared-app
179 mountPath: /tmp
180 - name: s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600181 image: {{ .Values.images.tags.mme | quote }}
182 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500183 command: ["bash", "-xc"]
184 args:
185 - /opt/mme/scripts/mme-run.sh s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600186 {{- if .Values.resources.enabled }}
187 resources:
188{{ toYaml .Values.resources.mme | indent 10 }}
189 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500190 volumeMounts:
191 - name: scripts
192 mountPath: /opt/mme/scripts/mme-run.sh
193 subPath: mme-run.sh
194 - name: shared-data
195 mountPath: /opt/mme/config/shared
196 - name: shared-app
197 mountPath: /tmp
198 volumes:
199 - name: scripts
200 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600201 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500202 defaultMode: 493
203 - name: configs
204 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600205 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500206 defaultMode: 420
207 - name: shared-data
208 emptyDir: {}
209 - name: shared-app
210 emptyDir: {}
Hyunsun Moonece86982019-09-27 17:44:59 -0500211 - name: host-rootfs
212 hostPath:
213 path: /