blob: 745388bd4cb44f993368450f2ff945d206929852 [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 Moon636e17d2019-07-03 12:52:15 -050061 - name: mme-dep-check
Hyunsun Moon06f98552019-08-15 13:44:47 -060062 image: {{ .Values.images.tags.depCheck | quote }}
63 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050064 securityContext:
65 allowPrivilegeEscalation: false
66 readOnlyRootFilesystem: false
67 runAsUser: 0
68 env:
69 - name: POD_NAME
70 valueFrom:
71 fieldRef:
72 apiVersion: v1
73 fieldPath: metadata.name
74 - name: NAMESPACE
75 valueFrom:
76 fieldRef:
77 apiVersion: v1
78 fieldPath: metadata.namespace
79 - name: PATH
80 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
81 - name: COMMAND
82 value: "echo done"
83 - name: DEPENDENCY_POD_JSON
Hyunsun Moon16d70922019-08-25 04:57:25 -050084 value: '[{"labels": {"app": "hss"}, "requireSameNode": false}]'
Hyunsun Moon636e17d2019-07-03 12:52:15 -050085 # add dependency job for make_certs.sh
86 command:
87 - kubernetes-entrypoint
88 volumeMounts:
89 []
90 - name: mme-init
Hyunsun Moon06f98552019-08-15 13:44:47 -060091 image: {{ .Values.images.tags.mme | quote }}
92 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050093 command: ["/opt/mme/scripts/mme-init.sh"]
94 env:
Hyunsun Moon16d70922019-08-25 04:57:25 -050095 - name: POD_IP
Hyunsun Moon636e17d2019-07-03 12:52:15 -050096 valueFrom:
97 fieldRef:
98 fieldPath: status.podIP
99 volumeMounts:
100 - name: scripts
101 mountPath: /opt/mme/scripts/mme-init.sh
102 subPath: mme-init.sh
103 - name: configs
104 mountPath: /opt/mme/config
105 - name: shared-data
106 mountPath: /opt/mme/config/shared
107 containers:
108 - name: mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600109 image: {{ .Values.images.tags.mme | quote }}
110 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500111 command: ["bash", "-xc"]
112 args:
113 - /opt/mme/scripts/mme-run.sh mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600114 {{- if .Values.resources.enabled }}
115 resources:
116{{ toYaml .Values.resources.mme | indent 10 }}
117 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500118 volumeMounts:
119 - name: scripts
120 mountPath: /opt/mme/scripts/mme-run.sh
121 subPath: mme-run.sh
122 - name: shared-data
123 mountPath: /opt/mme/config/shared
124 - name: shared-app
125 mountPath: /tmp
126 - name: s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600127 image: {{ .Values.images.tags.mme | quote }}
128 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500129 command: ["bash", "-xc"]
130 args:
131 - /opt/mme/scripts/mme-run.sh s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600132 {{- if .Values.resources.enabled }}
133 resources:
134{{ toYaml .Values.resources.mme | indent 10 }}
135 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500136 volumeMounts:
137 - name: scripts
138 mountPath: /opt/mme/scripts/mme-run.sh
139 subPath: mme-run.sh
140 - name: shared-data
141 mountPath: /opt/mme/config/shared
142 - name: shared-app
143 mountPath: /tmp
144 - name: s6a-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 s6a-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: s11-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 s11-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 volumes:
181 - name: scripts
182 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600183 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500184 defaultMode: 493
185 - name: configs
186 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600187 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500188 defaultMode: 420
189 - name: shared-data
190 emptyDir: {}
191 - name: shared-app
192 emptyDir: {}