blob: 962f0ff474e11f59c46de4dbbe9daa17e1f12aa0 [file] [log] [blame]
{{/*
# Copyright 2020-present Open Networking Foundation
# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
*/}}
{{- if .Values.config.udm.deploy }}
{{ tuple "udm" . | include "5g-control-plane.service_account" }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: udm
labels:
{{ tuple "udm" . | include "5g-control-plane.metadata_labels" | indent 4 }}
spec:
replicas: 1
#serviceName: udm-headless
selector:
matchLabels:
{{ tuple "udm" . | include "5g-control-plane.metadata_labels" | indent 6 }}
template:
metadata:
labels:
{{ tuple "udm" . | include "5g-control-plane.metadata_labels" | indent 8 }}
{{- with .Values.config.udm.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: udm
{{- if hasKey .Values.images "pullSecrets" }}
imagePullSecrets:
{{ toYaml .Values.images.pullSecrets | indent 8 }}
{{- end }}
initContainers:
- name: wait-udm-module
image: {{ .Values.images.tags.init | quote }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
command: ['sh', '-c', 'until nslookup udm; do echo waiting for udm; sleep 4; done;']
- name: wait-udr-module
image: {{ .Values.images.tags.init | quote }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
command: ['sh', '-c', 'until nslookup udr; do echo waiting for udr; sleep 4; done;']
{{- if .Values.config.coreDump.enabled }}
{{ tuple "udm" . | include "5g-control-plane.coredump_init" | indent 6 }}
{{- end }}
containers:
- name: udm
image: {{ .Values.images.tags.udm }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
{{- if .Values.config.coreDump.enabled }}
securityContext:
runAsUser: 0
{{- end }}
stdin: true
tty: true
command: ["/free5gc/script/udm-run.sh", "/sdcore/script/udm-run.sh"]
env:
- name: GRPC_GO_LOG_VERBOSITY_LEVEL
value: {{ .Values.config.grpc.golog_verbosity | quote }}
- name: GRPC_GO_LOG_SEVERITY_LEVEL
value: {{ .Values.config.grpc.severity | quote }}
- name: GRPC_TRACE
value: {{ .Values.config.grpc.trace | quote }}
- name: GRPC_VERBOSITY
value: {{ .Values.config.grpc.verbosity | quote }}
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
{{- if .Values.config.managedByConfigPod.enabled }}
- name: MANAGED_BY_CONFIG_POD
value: "true"
{{- end }}
{{- if .Values.resources.enabled }}
resources:
{{ toYaml .Values.resources.udm | indent 10 }}
{{- end }}
volumeMounts:
- name: run-script-tmp
mountPath: /free5gc/script/udm-run.sh
subPath: udm-run.sh
- name: nf-config-tmp
mountPath: /free5gc/config
- name: run-script
mountPath: /sdcore/script/udm-run.sh
subPath: udm-run.sh
- name: nf-config
mountPath: /sdcore/config
{{- if .Values.config.coreDump.enabled }}
- name: coredump
mountPath: /tmp/coredump
{{- end }}
volumes:
- name: run-script-tmp
configMap:
name: udm
defaultMode: 493
- name: nf-config-tmp
configMap:
name: udm
defaultMode: 493
- name: run-script
configMap:
name: udm
defaultMode: 493
- name: nf-config
configMap:
name: udm
defaultMode: 493
- name: config-dir
emptyDir: {}
{{- if .Values.config.coreDump.enabled }}
- name: host-rootfs
hostPath:
path: /
- name: coredump
hostPath:
path: {{ .Values.config.coreDump.path }}
{{- end }}
{{- end }}