blob: ac347d3c6d5fcb1e9adb6fec9caac1aaafb16a8b [file] [log] [blame]
badhri854c028b32021-11-03 18:24:05 -05001{{/*
2# Copyright 2020-present Open Networking Foundation
3
Ajay Lotan Thakur03189d22022-02-10 14:06:03 -06004# SPDX-License-Identifier: Apache-2.0
badhri854c028b32021-11-03 18:24:05 -05005*/}}
6
7{{- if .Values.config.udr.deploy }}
8{{ tuple "udr" . | include "5g-control-plane.service_account" }}
9---
10apiVersion: apps/v1
11kind: Deployment
12metadata:
13 name: udr
14 labels:
15{{ tuple "udr" . | include "5g-control-plane.metadata_labels" | indent 4 }}
16spec:
17 replicas: 1
18 #serviceName: udr-headless
19 selector:
20 matchLabels:
21{{ tuple "udr" . | include "5g-control-plane.metadata_labels" | indent 6 }}
22 template:
23 metadata:
24 labels:
25{{ tuple "udr" . | include "5g-control-plane.metadata_labels" | indent 8 }}
26 {{- with .Values.config.udr.podAnnotations }}
27 annotations:
28 {{- toYaml . | nindent 8 }}
29 {{- end }}
30 spec:
31 serviceAccountName: udr
32 {{- if hasKey .Values.images "pullSecrets" }}
33 imagePullSecrets:
34{{ toYaml .Values.images.pullSecrets | indent 8 }}
35 {{- end }}
badhri854c028b32021-11-03 18:24:05 -050036 {{- if .Values.config.coreDump.enabled }}
Ajay Lotan Thakurd9252122022-08-30 22:35:59 +000037 initContainers:
38 {{ tuple "udr" . | include "5g-control-plane.coredump_init" | indent 6 }}
badhri854c028b32021-11-03 18:24:05 -050039 {{- end }}
40 containers:
41 - name: udr
Ajay Lotan Thakur71115fe2022-03-03 22:26:08 -070042 image: {{ .Values.images.repository }}{{ .Values.images.tags.udr }}
badhri854c028b32021-11-03 18:24:05 -050043 imagePullPolicy: {{ .Values.images.pullPolicy }}
44 {{- if .Values.config.coreDump.enabled }}
45 securityContext:
46 runAsUser: 0
47 {{- end }}
48 stdin: true
49 tty: true
Ajay Thakurb0028b62022-02-04 17:47:29 +000050 command: ["/free5gc/script/udr-run.sh"]
badhri854c028b32021-11-03 18:24:05 -050051 env:
52 - name: GRPC_GO_LOG_VERBOSITY_LEVEL
53 value: {{ .Values.config.grpc.golog_verbosity | quote }}
54 - name: GRPC_GO_LOG_SEVERITY_LEVEL
55 value: {{ .Values.config.grpc.severity | quote }}
56 - name: GRPC_TRACE
57 value: {{ .Values.config.grpc.trace | quote }}
58 - name: GRPC_VERBOSITY
59 value: {{ .Values.config.grpc.verbosity | quote }}
60 - name: POD_IP
61 valueFrom:
62 fieldRef:
63 fieldPath: status.podIP
64 {{- if .Values.config.managedByConfigPod.enabled }}
65 - name: MANAGED_BY_CONFIG_POD
66 value: "true"
67 {{- end }}
68 {{- if .Values.resources.enabled }}
69 resources:
70{{ toYaml .Values.resources.udr | indent 10 }}
71 {{- end }}
72 volumeMounts:
Ajay Thakurb0028b62022-02-04 17:47:29 +000073 - name: run-script
badhri854c028b32021-11-03 18:24:05 -050074 mountPath: /free5gc/script/udr-run.sh
75 subPath: udr-run.sh
Vijaya Rani Tiruveeduladd579db2022-02-03 16:57:10 +053076 - name: nf-config
Ajay Thakurb0028b62022-02-04 17:47:29 +000077 mountPath: /free5gc/config
badhri854c028b32021-11-03 18:24:05 -050078 {{- if .Values.config.coreDump.enabled }}
79 - name: coredump
80 mountPath: /tmp/coredump
81 {{- end }}
82 volumes:
badhri854c028b32021-11-03 18:24:05 -050083 - name: run-script
84 configMap:
85 name: udr
86 defaultMode: 493
87 - name: nf-config
88 configMap:
89 name: udr
90 defaultMode: 493
91 {{- if .Values.config.coreDump.enabled }}
92 - name: host-rootfs
93 hostPath:
94 path: /
95 - name: coredump
96 hostPath:
97 path: {{ .Values.config.coreDump.path }}
98 {{- end }}
99{{- end }}