blob: 0d55e37c36801647bd564f8b2c408da25ac354b1 [file] [log] [blame]
{{/*
# Copyright 2020-present Open Networking Foundation
# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
*/}}
{{- if .Values.config.udr.deploy }}
{{ tuple "udr" . | include "5g-control-plane.service_account" }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: udr
labels:
{{ tuple "udr" . | include "5g-control-plane.metadata_labels" | indent 4 }}
spec:
replicas: 1
#serviceName: udr-headless
selector:
matchLabels:
{{ tuple "udr" . | include "5g-control-plane.metadata_labels" | indent 6 }}
template:
metadata:
labels:
{{ tuple "udr" . | include "5g-control-plane.metadata_labels" | indent 8 }}
{{- with .Values.config.udr.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: udr
{{- if hasKey .Values.images "pullSecrets" }}
imagePullSecrets:
{{ toYaml .Values.images.pullSecrets | indent 8 }}
{{- end }}
initContainers:
- 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 "udr" . | include "5g-control-plane.coredump_init" | indent 6 }}
{{- end }}
containers:
- name: udr
image: {{ .Values.images.tags.udr }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
{{- if .Values.config.coreDump.enabled }}
securityContext:
runAsUser: 0
{{- end }}
stdin: true
tty: true
command: ["/free5gc/script/udr-run.sh"]
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
{{- if .Values.resources.enabled }}
resources:
{{ toYaml .Values.resources.udr | indent 10 }}
{{- end }}
volumeMounts:
- name: run-script
mountPath: /free5gc/script/udr-run.sh
subPath: udr-run.sh
- name: config-dir
mountPath: /free5gc/config
- name: common-config
mountPath: /tmp/config/free5GC.conf
subPath: free5GC.conf
- name: nf-config
mountPath: /tmp/config/udrcfg.conf
subPath: udrcfg.conf
{{- if .Values.config.coreDump.enabled }}
- name: coredump
mountPath: /tmp/coredump
{{- end }}
volumes:
- name: run-script
configMap:
name: udr
defaultMode: 493
- name: common-config
configMap:
name: common
defaultMode: 493
- name: nf-config
configMap:
name: udr
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 }}