blob: 91eebc5315981d3cb8113e5fefb4bad546284220 [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.pcf.deploy }}
8{{ tuple "pcf" . | include "5g-control-plane.service_account" }}
9---
10apiVersion: apps/v1
11kind: Deployment
12metadata:
13 name: pcf
14 labels:
15{{ tuple "pcf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
16spec:
17 replicas: 1
18 #serviceName: pcf-headless
19 selector:
20 matchLabels:
21{{ tuple "pcf" . | include "5g-control-plane.metadata_labels" | indent 6 }}
22 template:
23 metadata:
24 labels:
25{{ tuple "pcf" . | include "5g-control-plane.metadata_labels" | indent 8 }}
26 {{- with .Values.config.pcf.podAnnotations }}
27 annotations:
28 {{- toYaml . | nindent 8 }}
29 {{- end }}
30 spec:
31 serviceAccountName: pcf
32 {{- if hasKey .Values.images "pullSecrets" }}
33 imagePullSecrets:
34{{ toYaml .Values.images.pullSecrets | indent 8 }}
35 {{- end }}
Ajay Lotan Thakurd9252122022-08-30 22:35:59 +000036 {{- if .Values.config.coreDump.enabled }}
badhri854c028b32021-11-03 18:24:05 -050037 initContainers:
Ajay Lotan Thakurd9252122022-08-30 22:35:59 +000038 {{ tuple "pcf" . | include "5g-control-plane.coredump_init" | indent 6 }}
39 {{- end }}
badhri854c028b32021-11-03 18:24:05 -050040 containers:
41 - name: pcf
Ajay Lotan Thakur71115fe2022-03-03 22:26:08 -070042 image: {{ .Values.images.repository }}{{ .Values.images.tags.pcf }}
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/pcf-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.pcf | 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/pcf-run.sh
75 subPath: pcf-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: pcf
86 defaultMode: 493
87 - name: nf-config
88 configMap:
89 name: pcf
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 }}