blob: f0e729087e6391a0175c69bdf66210819dc4977b [file] [log] [blame]
{{/*
Copyright 2019-present Open Networking Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{ tuple "mme" . | include "omec-control-plane.service_account" }}
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mme
labels:
{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 6 }}
serviceName: mme
template:
metadata:
labels:
{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 8 }}
spec:
{{- if .Values.nodeSelectors.enabled }}
nodeSelector:
{{ .Values.nodeSelectors.mme.label }}: {{ .Values.nodeSelectors.mme.value }}
{{- end }}
serviceAccountName: mme
initContainers:
{{- if not (hasKey .Values.config.spgwc "mmeAddr") }}
- name: mme-configmap-mme-ip
image: {{ .Values.images.tags.init | quote }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
env:
- name: NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
command: ["/opt/mme/scripts/mme-ip.sh"]
volumeMounts:
- name: scripts
mountPath: /opt/mme/scripts/mme-ip.sh
subPath: mme-ip.sh
{{- end }}
- name: mme-load-sctp-module
image: {{ .Values.images.tags.init | quote }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
securityContext:
privileged: true
runAsUser: 0
command: ["bash", "-xc"]
args:
- >
if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \
chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \
fi
volumeMounts:
- name: host-rootfs
mountPath: /mnt/host-rootfs
- name: mme-dep-check
image: {{ .Values.images.tags.depCheck | quote }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: false
runAsUser: 0
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: PATH
value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
- name: COMMAND
value: "echo done"
- name: DEPENDENCY_POD_JSON
value: '[{"labels": {"app": "hss"}, "requireSameNode": false}]'
# add dependency job for make_certs.sh
command:
- kubernetes-entrypoint
volumeMounts:
[]
- name: mme-init
image: {{ .Values.images.tags.mme | quote }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
command: ["/opt/mme/scripts/mme-init.sh"]
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
volumeMounts:
- name: scripts
mountPath: /opt/mme/scripts/mme-init.sh
subPath: mme-init.sh
- name: configs
mountPath: /opt/mme/config
- name: shared-data
mountPath: /opt/mme/config/shared
containers:
- name: mme-app
image: {{ .Values.images.tags.mme | quote }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
command: ["bash", "-xc"]
args:
- /opt/mme/scripts/mme-run.sh mme-app
{{- if .Values.resources.enabled }}
resources:
{{ toYaml .Values.resources.mme | indent 10 }}
{{- end }}
volumeMounts:
- name: scripts
mountPath: /opt/mme/scripts/mme-run.sh
subPath: mme-run.sh
- name: shared-data
mountPath: /opt/mme/config/shared
- name: shared-app
mountPath: /tmp
- name: s1ap-app
image: {{ .Values.images.tags.mme | quote }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
command: ["bash", "-xc"]
args:
- /opt/mme/scripts/mme-run.sh s1ap-app
{{- if .Values.resources.enabled }}
resources:
{{ toYaml .Values.resources.mme | indent 10 }}
{{- end }}
volumeMounts:
- name: scripts
mountPath: /opt/mme/scripts/mme-run.sh
subPath: mme-run.sh
- name: shared-data
mountPath: /opt/mme/config/shared
- name: shared-app
mountPath: /tmp
- name: s6a-app
image: {{ .Values.images.tags.mme | quote }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
command: ["bash", "-xc"]
args:
- /opt/mme/scripts/mme-run.sh s6a-app
{{- if .Values.resources.enabled }}
resources:
{{ toYaml .Values.resources.mme | indent 10 }}
{{- end }}
volumeMounts:
- name: scripts
mountPath: /opt/mme/scripts/mme-run.sh
subPath: mme-run.sh
- name: shared-data
mountPath: /opt/mme/config/shared
- name: shared-app
mountPath: /tmp
- name: s11-app
image: {{ .Values.images.tags.mme | quote }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
command: ["bash", "-xc"]
args:
- /opt/mme/scripts/mme-run.sh s11-app
{{- if .Values.resources.enabled }}
resources:
{{ toYaml .Values.resources.mme | indent 10 }}
{{- end }}
volumeMounts:
- name: scripts
mountPath: /opt/mme/scripts/mme-run.sh
subPath: mme-run.sh
- name: shared-data
mountPath: /opt/mme/config/shared
- name: shared-app
mountPath: /tmp
volumes:
- name: scripts
configMap:
name: mme
defaultMode: 493
- name: configs
configMap:
name: mme
defaultMode: 420
- name: shared-data
emptyDir: {}
- name: shared-app
emptyDir: {}
- name: host-rootfs
hostPath:
path: /