blob: 994e85ffd3895ad89a0cf3298495d2d654cf3366 [file] [log] [blame]
{{/*
# Copyright 2020-present Open Networking Foundation
# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
*/}}
{{- if .Values.config.amf.deploy }}
{{ tuple "amf" . | include "5g-control-plane.service_account" }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: amf
labels:
{{ tuple "amf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
spec:
replicas: 1
#serviceName: amf-headless
selector:
matchLabels:
{{ tuple "amf" . | include "5g-control-plane.metadata_labels" | indent 6 }}
template:
metadata:
labels:
{{ tuple "amf" . | include "5g-control-plane.metadata_labels" | indent 8 }}
{{- with .Values.config.amf.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: amf
{{- if hasKey .Values.images "pullSecrets" }}
imagePullSecrets:
{{ toYaml .Values.images.pullSecrets | indent 8 }}
{{- end }}
initContainers:
- name: wait-nrf-module
image: {{ .Values.images.tags.init | quote }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
command: ['sh', '-c', 'until nslookup nrf; do echo waiting for nrf; sleep 4; done;']
{{- if .Values.config.coreDump.enabled }}
{{ tuple "amf" . | include "5g-control-plane.coredump_init" | indent 6 }}
{{- end }}
containers:
- name: amf
image: {{ .Values.images.tags.amf }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
{{- if .Values.config.coreDump.enabled }}
securityContext:
runAsUser: 0
{{- end }}
stdin: true
tty: true
command: ["/free5gc/script/amf-run.sh"]
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
{{- if .Values.resources.enabled }}
resources:
{{ toYaml .Values.resources.amf | indent 10 }}
{{- end }}
volumeMounts:
- name: run-script
mountPath: /free5gc/script/amf-run.sh
subPath: amf-run.sh
- name: amf-config
mountPath: /free5gc/config
- name: common-config
mountPath: /free5gc/common
{{- if .Values.config.coreDump.enabled }}
- name: coredump
mountPath: /tmp/coredump
{{- end }}
volumes:
- name: run-script
configMap:
name: amf
defaultMode: 493
- name: common-config
configMap:
name: common
defaultMode: 493
- name: amf-config
configMap:
name: amf
defaultMode: 493
{{- if .Values.config.coreDump.enabled }}
- name: host-rootfs
hostPath:
path: /
- name: coredump
hostPath:
path: {{ .Values.config.coreDump.path }}
{{- end }}
{{- end }}