blob: 44c7e3887879f8711c08aa0375a4df0b7f35363f [file] [log] [blame]
Yi Tseng32561422021-10-07 15:03:21 -07001{{/*
2# Copyright 2020-present Open Networking Foundation
3
Charles Chand1b4bf92022-02-02 16:27:10 -08004# SPDX-License-Identifier: Apache-2.0
Yi Tseng32561422021-10-07 15:03:21 -07005*/}}
6
7{{- $upfConfig := index .Values.config.pfcp.cfgFiles "upf.json" }}
8---
9apiVersion: apps/v1
10kind: StatefulSet
11metadata:
12 name: {{ include "pfcp-agent.fullname" . }}
13 labels:
14{{ tuple "pfcp" . | include "pfcp-agent.metadata_labels" | indent 4 }}
15spec:
16 replicas: 1
17 serviceName: pfcp-headless
18 selector:
19 matchLabels:
20{{ tuple "pfcp" . | include "pfcp-agent.metadata_labels" | indent 6 }}
21 template:
22 metadata:
23 labels:
24{{ tuple "pfcp" . | include "pfcp-agent.metadata_labels" | indent 8 }}
25 spec:
26 shareProcessNamespace: true
27 {{- if .Values.nodeSelectors.enabled }}
28 nodeSelector:
29 {{ .Values.nodeSelectors.pfcp.label }}: {{ .Values.nodeSelectors.pfcp.value }}
30 {{- end }}
31 {{- if .Values.images.pullSecrets }}
32 imagePullSecrets:
33 {{- range .Values.images.pullSecrets }}
34 - name: {{ . | quote }}
35 {{- end }}
36 {{- end }}
37 {{- if .Values.config.coreDump.enabled }}
38 initContainers:
39{{ tuple "pfcp" . | include "pfcp-agent.coredump_init" | indent 8 }}
40 {{- end }}
41 containers:
42 - name: {{ include "pfcp-agent.fullname" . }}
43 image: {{ .Values.images.tags.pfcpiface | quote }}
44 imagePullPolicy: {{ .Values.images.pullPolicy | quote }}
45 env:
46 - name: POD_IP
47 valueFrom:
48 fieldRef:
49 fieldPath: status.podIP
50 command: ["pfcpiface"]
51 args:
52 - -config
53 - /tmp/conf/upf.json
54 {{- if .Values.resources.enabled }}
55 resources:
56{{ toYaml .Values.resources.pfcpiface | indent 10 }}
57 {{- end }}
58 volumeMounts:
59 - name: configs
60 mountPath: /tmp/conf
61 volumes:
62 - name: configs
63 configMap:
64 name: {{ include "pfcp-agent.fullname" . }}
65 defaultMode: 493
66 {{- if .Values.config.coreDump.enabled }}
67 - name: host-rootfs
68 hostPath:
69 path: /
70 - name: coredump
71 hostPath:
72 path: {{ .Values.config.coreDump.path }}
73 {{- end }}