blob: d979decee8bc95783e1e34c869d9b6505dbaa9e6 [file] [log] [blame]
{{/*
# Copyright 2020-present Open Networking Foundation
# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
*/}}
{{- $upfConfig := index .Values.config.pfcp.cfgFiles "upf.json" }}
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: pfcp
labels:
{{ tuple "pfcp" . | include "omec-upf-pfcp-agent.metadata_labels" | indent 4 }}
spec:
replicas: 1
serviceName: pfcp-headless
selector:
matchLabels:
{{ tuple "pfcp" . | include "omec-upf-pfcp-agent.metadata_labels" | indent 6 }}
template:
metadata:
labels:
{{ tuple "pfcp" . | include "omec-upf-pfcp-agent.metadata_labels" | indent 8 }}
spec:
shareProcessNamespace: true
{{- if .Values.nodeSelectors.enabled }}
nodeSelector:
{{ .Values.nodeSelectors.pfcp.label }}: {{ .Values.nodeSelectors.pfcp.value }}
{{- end }}
{{- if .Values.images.credentials }}
imagePullSecrets:
- name: {{ .Release.Name }}.registry
{{- end }}
{{- if .Values.config.coreDump.enabled }}
initContainers:
{{ tuple "pfcp" . | include "omec-upf-pfcp-agent.coredump_init" | indent 8 }}
{{- end }}
containers:
- name: pfcp-agent
image: {{ .Values.images.tags.pfcpiface | quote }}
imagePullPolicy: {{ .Values.images.pullPolicy | quote }}
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
command: ["pfcpiface"]
args:
- -config
- /opt/bess/bessctl/conf/upf.json
- -n4SrcIPStr
- $(POD_IP)
- -p4RtcServerIP
- {{ .Values.config.pfcp.p4RtcServer.addr }}
- -p4RtcServerPort
- {{ .Values.config.pfcp.p4RtcServer.port | quote }}
{{- if .Values.resources.enabled }}
resources:
{{ toYaml .Values.resources.pfcpiface | indent 10 }}
{{- end }}
volumeMounts:
- name: configs
mountPath: /tmp/conf
volumes:
- name: configs
configMap:
name: pfcp
defaultMode: 493
{{- if .Values.config.coreDump.enabled }}
- name: host-rootfs
hostPath:
path: /
- name: coredump
hostPath:
path: {{ .Values.config.coreDump.path }}
{{- end }}