blob: a7f7a652b451af96d2aaa2025d5189eec9abe338 [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 }}
35 initContainers:
Ajay Thakurb0028b62022-02-04 17:47:29 +000036 - name: wait-nrf-module
badhri854c028b32021-11-03 18:24:05 -050037 image: {{ .Values.images.tags.init | quote }}
38 imagePullPolicy: {{ .Values.images.pullPolicy }}
Ajay Thakurb0028b62022-02-04 17:47:29 +000039 command: ['sh', '-c', 'until nslookup nrf; do echo waiting for nrf; sleep 4; done;']
badhri854c028b32021-11-03 18:24:05 -050040 {{- if .Values.config.coreDump.enabled }}
41{{ tuple "amf" . | include "5g-control-plane.coredump_init" | indent 6 }}
42 {{- end }}
43 containers:
44 - name: amf
45 image: {{ .Values.images.tags.amf }}
46 imagePullPolicy: {{ .Values.images.pullPolicy }}
47 {{- if .Values.config.coreDump.enabled }}
48 securityContext:
49 runAsUser: 0
50 {{- end }}
51 stdin: true
52 tty: true
Ajay Thakurb0028b62022-02-04 17:47:29 +000053 command: [ {{ .Values.config.imagePath }}/script/amf-run.sh ]
badhri854c028b32021-11-03 18:24:05 -050054 env:
55 - name: GRPC_GO_LOG_VERBOSITY_LEVEL
56 value: {{ .Values.config.grpc.golog_verbosity | quote }}
57 - name: GRPC_GO_LOG_SEVERITY_LEVEL
58 value: {{ .Values.config.grpc.severity | quote }}
59 - name: GRPC_TRACE
60 value: {{ .Values.config.grpc.trace | quote }}
61 - name: GRPC_VERBOSITY
62 value: {{ .Values.config.grpc.verbosity | quote }}
63 - name: POD_IP
64 valueFrom:
65 fieldRef:
66 fieldPath: status.podIP
67 {{- if .Values.config.managedByConfigPod.enabled }}
68 - name: MANAGED_BY_CONFIG_POD
69 value: "true"
70 {{- end }}
71 {{- if .Values.resources.enabled }}
72 resources:
73{{ toYaml .Values.resources.amf | indent 10 }}
74 {{- end }}
75 volumeMounts:
Vijaya Rani Tiruveeduladd579db2022-02-03 16:57:10 +053076 - name: run-script
Ajay Thakurb0028b62022-02-04 17:47:29 +000077 mountPath: {{ .Values.config.imagePath }}/script/amf-run.sh
Vijaya Rani Tiruveeduladd579db2022-02-03 16:57:10 +053078 subPath: amf-run.sh
Ajay Thakurb0028b62022-02-04 17:47:29 +000079 - name: amf-config
80 mountPath: {{ .Values.config.imagePath }}/config
badhri854c028b32021-11-03 18:24:05 -050081 {{- if .Values.config.coreDump.enabled }}
82 - name: coredump
83 mountPath: /tmp/coredump
84 {{- end }}
85 volumes:
86 - name: run-script
87 configMap:
88 name: amf
89 defaultMode: 493
Ajay Thakurb0028b62022-02-04 17:47:29 +000090 - name: amf-config
badhri854c028b32021-11-03 18:24:05 -050091 configMap:
92 name: amf
93 defaultMode: 493
94 {{- if .Values.config.coreDump.enabled }}
95 - name: host-rootfs
96 hostPath:
97 path: /
98 - name: coredump
99 hostPath:
100 path: {{ .Values.config.coreDump.path }}
101 {{- end }}
102{{- end }}