blob: 44c7e3887879f8711c08aa0375a4df0b7f35363f [file] [log] [blame]
{{/*
# Copyright 2020-present Open Networking Foundation
# SPDX-License-Identifier: Apache-2.0
*/}}
{{- $upfConfig := index .Values.config.pfcp.cfgFiles "upf.json" }}
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "pfcp-agent.fullname" . }}
labels:
{{ tuple "pfcp" . | include "pfcp-agent.metadata_labels" | indent 4 }}
spec:
replicas: 1
serviceName: pfcp-headless
selector:
matchLabels:
{{ tuple "pfcp" . | include "pfcp-agent.metadata_labels" | indent 6 }}
template:
metadata:
labels:
{{ tuple "pfcp" . | include "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.pullSecrets }}
imagePullSecrets:
{{- range .Values.images.pullSecrets }}
- name: {{ . | quote }}
{{- end }}
{{- end }}
{{- if .Values.config.coreDump.enabled }}
initContainers:
{{ tuple "pfcp" . | include "pfcp-agent.coredump_init" | indent 8 }}
{{- end }}
containers:
- name: {{ include "pfcp-agent.fullname" . }}
image: {{ .Values.images.tags.pfcpiface | quote }}
imagePullPolicy: {{ .Values.images.pullPolicy | quote }}
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
command: ["pfcpiface"]
args:
- -config
- /tmp/conf/upf.json
{{- if .Values.resources.enabled }}
resources:
{{ toYaml .Values.resources.pfcpiface | indent 10 }}
{{- end }}
volumeMounts:
- name: configs
mountPath: /tmp/conf
volumes:
- name: configs
configMap:
name: {{ include "pfcp-agent.fullname" . }}
defaultMode: 493
{{- if .Values.config.coreDump.enabled }}
- name: host-rootfs
hostPath:
path: /
- name: coredump
hostPath:
path: {{ .Values.config.coreDump.path }}
{{- end }}