badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 1 | {{/* |
| 2 | # Copyright 2020-present Open Networking Foundation |
| 3 | |
Ajay Lotan Thakur | 03189d2 | 2022-02-10 14:06:03 -0600 | [diff] [blame] | 4 | # SPDX-License-Identifier: Apache-2.0 |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 5 | */}} |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 6 | {{- if .Values.config.amf.deploy }} |
| 7 | {{ tuple "amf" . | include "5g-control-plane.service_account" }} |
| 8 | --- |
| 9 | apiVersion: apps/v1 |
| 10 | kind: Deployment |
| 11 | metadata: |
| 12 | name: amf |
| 13 | labels: |
| 14 | {{ tuple "amf" . | include "5g-control-plane.metadata_labels" | indent 4 }} |
| 15 | spec: |
| 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 Thakur | b0028b6 | 2022-02-04 17:47:29 +0000 | [diff] [blame] | 36 | - name: wait-nrf-module |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 37 | image: {{ .Values.images.tags.init | quote }} |
| 38 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
Ajay Thakur | b0028b6 | 2022-02-04 17:47:29 +0000 | [diff] [blame] | 39 | command: ['sh', '-c', 'until nslookup nrf; do echo waiting for nrf; sleep 4; done;'] |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 40 | {{- 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 Thakur | b0028b6 | 2022-02-04 17:47:29 +0000 | [diff] [blame] | 53 | command: [ {{ .Values.config.imagePath }}/script/amf-run.sh ] |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 54 | 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 Tiruveedula | dd579db | 2022-02-03 16:57:10 +0530 | [diff] [blame] | 76 | - name: run-script |
Ajay Thakur | b0028b6 | 2022-02-04 17:47:29 +0000 | [diff] [blame] | 77 | mountPath: {{ .Values.config.imagePath }}/script/amf-run.sh |
Vijaya Rani Tiruveedula | dd579db | 2022-02-03 16:57:10 +0530 | [diff] [blame] | 78 | subPath: amf-run.sh |
Ajay Thakur | b0028b6 | 2022-02-04 17:47:29 +0000 | [diff] [blame] | 79 | - name: amf-config |
| 80 | mountPath: {{ .Values.config.imagePath }}/config |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 81 | {{- 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 Thakur | b0028b6 | 2022-02-04 17:47:29 +0000 | [diff] [blame] | 90 | - name: amf-config |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 91 | 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 }} |