Badhrinath Pa | 083686a | 2020-09-29 21:51:42 -0700 | [diff] [blame] | 1 | {{/* |
| 2 | # Copyright 2020-present Open Networking Foundation |
| 3 | |
| 4 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 5 | */}} |
| 6 | |
| 7 | {{- $upfConfig := index .Values.config.pfcp.cfgFiles "upf.json" }} |
| 8 | --- |
| 9 | apiVersion: apps/v1 |
| 10 | kind: StatefulSet |
| 11 | metadata: |
| 12 | name: pfcp |
| 13 | labels: |
| 14 | {{ tuple "pfcp" . | include "omec-upf-pfcp-agent.metadata_labels" | indent 4 }} |
| 15 | spec: |
| 16 | replicas: 1 |
| 17 | serviceName: pfcp-headless |
| 18 | selector: |
| 19 | matchLabels: |
| 20 | {{ tuple "pfcp" . | include "omec-upf-pfcp-agent.metadata_labels" | indent 6 }} |
| 21 | template: |
| 22 | metadata: |
| 23 | labels: |
| 24 | {{ tuple "pfcp" . | include "omec-upf-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.config.coreDump.enabled }} |
| 32 | {{ tuple "pfcp" . | include "omec-upf-pfcp-agent.coredump_init" | indent 8 }} |
| 33 | {{- end }} |
| 34 | containers: |
| 35 | - name: pfcp-agent |
| 36 | image: {{ .Values.images.tags.pfcpiface | quote }} |
| 37 | imagePullPolicy: {{ .Values.images.pullPolicy | quote }} |
| 38 | env: |
| 39 | - name: POD_IP |
| 40 | valueFrom: |
| 41 | fieldRef: |
| 42 | fieldPath: status.podIP |
| 43 | command: ["pfcpiface"] |
| 44 | args: |
| 45 | - -config |
| 46 | - /opt/bess/bessctl/conf/upf.json |
| 47 | - -n4SrcIPStr |
| 48 | - $(POD_IP) |
| 49 | - -p4RtcServerIP |
| 50 | - {{ .Values.config.pfcp.p4RtcServer.addr }} |
| 51 | - -p4RtcServerPort |
| 52 | - {{ .Values.config.pfcp.p4RtcServer.port | quote }} |
| 53 | {{- if .Values.resources.enabled }} |
| 54 | resources: |
| 55 | {{ toYaml .Values.resources.pfcpiface | indent 10 }} |
| 56 | {{- end }} |
| 57 | volumeMounts: |
| 58 | - name: configs |
| 59 | mountPath: /tmp/conf |
| 60 | volumes: |
| 61 | - name: configs |
| 62 | configMap: |
| 63 | name: pfcp |
| 64 | defaultMode: 493 |
| 65 | {{- if .Values.config.coreDump.enabled }} |
| 66 | - name: host-rootfs |
| 67 | hostPath: |
| 68 | path: / |
| 69 | - name: coredump |
| 70 | hostPath: |
| 71 | path: {{ .Values.config.coreDump.path }} |
| 72 | {{- end }} |