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 }} |
Hyunsun Moon | 8da1788 | 2020-10-14 21:28:44 -0500 | [diff] [blame] | 31 | {{- if .Values.images.credentials }} |
| 32 | imagePullSecrets: |
| 33 | - name: {{ .Release.Name }}.registry |
| 34 | {{- end }} |
Badhrinath Pa | 083686a | 2020-09-29 21:51:42 -0700 | [diff] [blame] | 35 | {{- if .Values.config.coreDump.enabled }} |
Hyunsun Moon | 8da1788 | 2020-10-14 21:28:44 -0500 | [diff] [blame] | 36 | initContainers: |
Badhrinath Pa | 083686a | 2020-09-29 21:51:42 -0700 | [diff] [blame] | 37 | {{ tuple "pfcp" . | include "omec-upf-pfcp-agent.coredump_init" | indent 8 }} |
| 38 | {{- end }} |
| 39 | containers: |
| 40 | - name: pfcp-agent |
| 41 | image: {{ .Values.images.tags.pfcpiface | quote }} |
| 42 | imagePullPolicy: {{ .Values.images.pullPolicy | quote }} |
| 43 | env: |
| 44 | - name: POD_IP |
| 45 | valueFrom: |
| 46 | fieldRef: |
| 47 | fieldPath: status.podIP |
| 48 | command: ["pfcpiface"] |
| 49 | args: |
| 50 | - -config |
badhrinath | 78857fc | 2020-10-22 15:43:17 -0500 | [diff] [blame] | 51 | - /tmp/conf/upf.json |
Badhrinath Pa | 083686a | 2020-09-29 21:51:42 -0700 | [diff] [blame] | 52 | - -n4SrcIPStr |
| 53 | - $(POD_IP) |
Badhrinath Pa | 083686a | 2020-09-29 21:51:42 -0700 | [diff] [blame] | 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: pfcp |
| 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 }} |