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 | 7eb0c1d | 2021-06-04 10:56:53 -0700 | [diff] [blame] | 31 | {{- if hasKey .Values.images "pullSecrets" }} |
Hyunsun Moon | 8da1788 | 2020-10-14 21:28:44 -0500 | [diff] [blame] | 32 | imagePullSecrets: |
Hyunsun Moon | 7eb0c1d | 2021-06-04 10:56:53 -0700 | [diff] [blame] | 33 | {{ toYaml .Values.images.pullSecrets | indent 8 }} |
Hyunsun Moon | 8da1788 | 2020-10-14 21:28:44 -0500 | [diff] [blame] | 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 | {{- if .Values.resources.enabled }} |
| 53 | resources: |
| 54 | {{ toYaml .Values.resources.pfcpiface | indent 10 }} |
| 55 | {{- end }} |
| 56 | volumeMounts: |
| 57 | - name: configs |
| 58 | mountPath: /tmp/conf |
| 59 | volumes: |
| 60 | - name: configs |
| 61 | configMap: |
| 62 | name: pfcp |
| 63 | defaultMode: 493 |
| 64 | {{- if .Values.config.coreDump.enabled }} |
| 65 | - name: host-rootfs |
| 66 | hostPath: |
| 67 | path: / |
| 68 | - name: coredump |
| 69 | hostPath: |
| 70 | path: {{ .Values.config.coreDump.path }} |
| 71 | {{- end }} |