blob: af37c346aed14411a87986254e898b62d24127f4 [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 Moon636e17d2019-07-03 12:52:15 -050017---
18apiVersion: v1
19kind: ServiceAccount
20metadata:
Hyunsun Moon06f98552019-08-15 13:44:47 -060021 name: mme
22 labels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060023{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050024---
25kind: Role
26apiVersion: rbac.authorization.k8s.io/v1
27metadata:
Hyunsun Moon06f98552019-08-15 13:44:47 -060028 name: mme
29 labels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060030{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050031rules:
32 - apiGroups:
33 - ""
34 - extensions
35 - batch
36 - apps
37 verbs:
38 - get
39 - list
40 resources:
41 - daemonsets
42 - jobs
43 - pods
44 - services
45 - endpoints
46---
47kind: RoleBinding
48apiVersion: rbac.authorization.k8s.io/v1
49metadata:
Hyunsun Moon06f98552019-08-15 13:44:47 -060050 name: mme
51 labels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060052{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050053roleRef:
54 apiGroup: rbac.authorization.k8s.io
55 kind: Role
Hyunsun Moon06f98552019-08-15 13:44:47 -060056 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -050057subjects:
58- kind: ServiceAccount
Hyunsun Moon06f98552019-08-15 13:44:47 -060059 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -050060---
61apiVersion: apps/v1
62kind: StatefulSet
63metadata:
Hyunsun Moon06f98552019-08-15 13:44:47 -060064 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -050065 labels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060066{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050067spec:
68 replicas: 1
69 selector:
70 matchLabels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060071{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 6 }}
Hyunsun Moon06f98552019-08-15 13:44:47 -060072 serviceName: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -050073 template:
74 metadata:
75 labels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060076{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 8 }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050077 spec:
Hyunsun Moon06f98552019-08-15 13:44:47 -060078 {{- if .Values.nodeSelectors.enabled }}
79 nodeSelector:
80 {{ .Values.nodeSelectors.mme.label }}: {{ .Values.nodeSelectors.mme.value }}
81 {{- end }}
82 serviceAccountName: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -050083 initContainers:
84 - name: mme-dep-check
Hyunsun Moon06f98552019-08-15 13:44:47 -060085 image: {{ .Values.images.tags.depCheck | quote }}
86 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -050087 securityContext:
88 allowPrivilegeEscalation: false
89 readOnlyRootFilesystem: false
90 runAsUser: 0
91 env:
92 - name: POD_NAME
93 valueFrom:
94 fieldRef:
95 apiVersion: v1
96 fieldPath: metadata.name
97 - name: NAMESPACE
98 valueFrom:
99 fieldRef:
100 apiVersion: v1
101 fieldPath: metadata.namespace
102 - name: PATH
103 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
104 - name: COMMAND
105 value: "echo done"
106 - name: DEPENDENCY_POD_JSON
Hyunsun Moon06f98552019-08-15 13:44:47 -0600107 value: '[{"labels": {"app": "spgwc"}, "requireSameNode": false}, {"labels": {"app": "hss"}, "requireSameNode": false}]'
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500108 # add dependency job for make_certs.sh
109 command:
110 - kubernetes-entrypoint
111 volumeMounts:
112 []
113 - name: mme-init
Hyunsun Moon06f98552019-08-15 13:44:47 -0600114 image: {{ .Values.images.tags.mme | quote }}
115 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500116 command: ["/opt/mme/scripts/mme-init.sh"]
117 env:
118 - name: MME_LOCAL_IP
119 valueFrom:
120 fieldRef:
121 fieldPath: status.podIP
122 volumeMounts:
123 - name: scripts
124 mountPath: /opt/mme/scripts/mme-init.sh
125 subPath: mme-init.sh
126 - name: configs
127 mountPath: /opt/mme/config
128 - name: shared-data
129 mountPath: /opt/mme/config/shared
130 containers:
131 - name: mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600132 image: {{ .Values.images.tags.mme | quote }}
133 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500134 command: ["bash", "-xc"]
135 args:
136 - /opt/mme/scripts/mme-run.sh mme-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600137 {{- if .Values.resources.enabled }}
138 resources:
139{{ toYaml .Values.resources.mme | indent 10 }}
140 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500141 volumeMounts:
142 - name: scripts
143 mountPath: /opt/mme/scripts/mme-run.sh
144 subPath: mme-run.sh
145 - name: shared-data
146 mountPath: /opt/mme/config/shared
147 - name: shared-app
148 mountPath: /tmp
149 - name: s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600150 image: {{ .Values.images.tags.mme | quote }}
151 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500152 command: ["bash", "-xc"]
153 args:
154 - /opt/mme/scripts/mme-run.sh s1ap-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600155 {{- if .Values.resources.enabled }}
156 resources:
157{{ toYaml .Values.resources.mme | indent 10 }}
158 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500159 volumeMounts:
160 - name: scripts
161 mountPath: /opt/mme/scripts/mme-run.sh
162 subPath: mme-run.sh
163 - name: shared-data
164 mountPath: /opt/mme/config/shared
165 - name: shared-app
166 mountPath: /tmp
167 - name: s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600168 image: {{ .Values.images.tags.mme | quote }}
169 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500170 command: ["bash", "-xc"]
171 args:
172 - /opt/mme/scripts/mme-run.sh s6a-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600173 {{- if .Values.resources.enabled }}
174 resources:
175{{ toYaml .Values.resources.mme | indent 10 }}
176 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500177 volumeMounts:
178 - name: scripts
179 mountPath: /opt/mme/scripts/mme-run.sh
180 subPath: mme-run.sh
181 - name: shared-data
182 mountPath: /opt/mme/config/shared
183 - name: shared-app
184 mountPath: /tmp
185 - name: s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600186 image: {{ .Values.images.tags.mme | quote }}
187 imagePullPolicy: {{ .Values.images.pullPolicy }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500188 command: ["bash", "-xc"]
189 args:
190 - /opt/mme/scripts/mme-run.sh s11-app
Hyunsun Moon06f98552019-08-15 13:44:47 -0600191 {{- if .Values.resources.enabled }}
192 resources:
193{{ toYaml .Values.resources.mme | indent 10 }}
194 {{- end }}
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500195 volumeMounts:
196 - name: scripts
197 mountPath: /opt/mme/scripts/mme-run.sh
198 subPath: mme-run.sh
199 - name: shared-data
200 mountPath: /opt/mme/config/shared
201 - name: shared-app
202 mountPath: /tmp
203 volumes:
204 - name: scripts
205 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600206 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500207 defaultMode: 493
208 - name: configs
209 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600210 name: mme
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500211 defaultMode: 420
212 - name: shared-data
213 emptyDir: {}
214 - name: shared-app
215 emptyDir: {}