blob: e91b18829f1452dbcfa7a36077296148a2652bf1 [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*/}}
badhri854c028b32021-11-03 18:24:05 -05006{{- if .Values.config.amf.deploy }}
7{{ tuple "amf" . | include "5g-control-plane.service_account" }}
8---
9apiVersion: apps/v1
10kind: Deployment
11metadata:
12 name: amf
13 labels:
14{{ tuple "amf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
15spec:
16 replicas: 1
17 #serviceName: amf-headless
18 selector:
19 matchLabels:
20{{ tuple "amf" . | include "5g-control-plane.metadata_labels" | indent 6 }}
21 template:
22 metadata:
23 labels:
24{{ tuple "amf" . | include "5g-control-plane.metadata_labels" | indent 8 }}
25 {{- with .Values.config.amf.podAnnotations }}
26 annotations:
27 {{- toYaml . | nindent 8 }}
28 {{- end }}
29 spec:
30 serviceAccountName: amf
31 {{- if hasKey .Values.images "pullSecrets" }}
32 imagePullSecrets:
33{{ toYaml .Values.images.pullSecrets | indent 8 }}
34 {{- end }}
Ajay Lotan Thakurd9252122022-08-30 22:35:59 +000035 {{- if .Values.config.coreDump.enabled }}
36 initContainers:
37 {{ tuple "amf" . | include "5g-control-plane.coredump_init" | indent 6 }}
38 {{- end }}
badhri854c028b32021-11-03 18:24:05 -050039 containers:
40 - name: amf
Ajay Lotan Thakur71115fe2022-03-03 22:26:08 -070041 image: {{ .Values.images.repository }}{{ .Values.images.tags.amf }}
badhri854c028b32021-11-03 18:24:05 -050042 imagePullPolicy: {{ .Values.images.pullPolicy }}
43 {{- if .Values.config.coreDump.enabled }}
44 securityContext:
45 runAsUser: 0
46 {{- end }}
47 stdin: true
48 tty: true
Ajay Thakurb0028b62022-02-04 17:47:29 +000049 command: [ {{ .Values.config.imagePath }}/script/amf-run.sh ]
Vijaya Tiruveedula863664c2022-08-04 20:47:32 +053050 command: [ "/bin/bash", "-c" ]
51 args:
52 - "cat {{ .Values.config.imagePath }}/config/amfcfg.conf && GOTRACEBACK=crash {{ .Values.config.imagePath }}/amf/amf -amfcfg {{ .Values.config.imagePath }}/config/amfcfg.conf"
badhri854c028b32021-11-03 18:24:05 -050053 env:
54 - name: GRPC_GO_LOG_VERBOSITY_LEVEL
55 value: {{ .Values.config.grpc.golog_verbosity | quote }}
56 - name: GRPC_GO_LOG_SEVERITY_LEVEL
57 value: {{ .Values.config.grpc.severity | quote }}
58 - name: GRPC_TRACE
59 value: {{ .Values.config.grpc.trace | quote }}
60 - name: GRPC_VERBOSITY
61 value: {{ .Values.config.grpc.verbosity | quote }}
62 - name: POD_IP
63 valueFrom:
64 fieldRef:
65 fieldPath: status.podIP
66 {{- if .Values.config.managedByConfigPod.enabled }}
67 - name: MANAGED_BY_CONFIG_POD
68 value: "true"
69 {{- end }}
70 {{- if .Values.resources.enabled }}
71 resources:
72{{ toYaml .Values.resources.amf | indent 10 }}
73 {{- end }}
74 volumeMounts:
Vijaya Rani Tiruveeduladd579db2022-02-03 16:57:10 +053075 - name: run-script
Ajay Thakurb0028b62022-02-04 17:47:29 +000076 mountPath: {{ .Values.config.imagePath }}/script/amf-run.sh
Vijaya Rani Tiruveeduladd579db2022-02-03 16:57:10 +053077 subPath: amf-run.sh
Ajay Thakurb0028b62022-02-04 17:47:29 +000078 - name: amf-config
79 mountPath: {{ .Values.config.imagePath }}/config
badhri854c028b32021-11-03 18:24:05 -050080 {{- if .Values.config.coreDump.enabled }}
81 - name: coredump
82 mountPath: /tmp/coredump
83 {{- end }}
84 volumes:
85 - name: run-script
86 configMap:
87 name: amf
88 defaultMode: 493
Ajay Thakurb0028b62022-02-04 17:47:29 +000089 - name: amf-config
badhri854c028b32021-11-03 18:24:05 -050090 configMap:
91 name: amf
92 defaultMode: 493
93 {{- if .Values.config.coreDump.enabled }}
94 - name: host-rootfs
95 hostPath:
96 path: /
97 - name: coredump
98 hostPath:
99 path: {{ .Values.config.coreDump.path }}
100 {{- end }}
101{{- end }}