blob: fe6c73e6cc9e3efef5919c8be92af34b77a1c6c6 [file] [log] [blame]
Ajay Lotan Thakurc3cd6192020-10-12 20:12:38 -05001{{/*
2# Copyright 2020-present Open Networking Foundation
3
4# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
5
6Default values for mcord-vepc-helm.
7This is a YAML-formatted file.
8Declare variables to be passed into your templates.
9*/}}
10
11{{- if .Values.config.pcrf.deploy }}
12{{ tuple "pcrf" . | include "omec-control-plane.service_account" }}
13---
14apiVersion: apps/v1
15kind: StatefulSet
16metadata:
17 name: pcrf
18 labels:
19{{ tuple "pcrf" . | include "omec-control-plane.metadata_labels" | indent 4 }}
20spec:
21 replicas: 1
22 serviceName: pcrf-headless
23 selector:
24 matchLabels:
25{{ tuple "pcrf" . | include "omec-control-plane.metadata_labels" | indent 6 }}
26 template:
27 metadata:
28 labels:
29{{ tuple "pcrf" . | include "omec-control-plane.metadata_labels" | indent 8 }}
30 spec:
31 {{- if .Values.nodeSelectors.enabled }}
32 nodeSelector:
33 {{ .Values.nodeSelectors.pcrf.label }}: {{ .Values.nodeSelectors.pcrf.value }}
34 {{- end }}
35 {{- if .Values.images.credentials }}
36 imagePullSecrets:
37 - name: {{ .Release.Name }}.registry
38 {{- end }}
39 serviceAccountName: pcrf
40 initContainers:
41 - name: pcrf-bootstrap
42 image: {{ .Values.images.tags.pcrfdb }}
43 imagePullPolicy: {{ .Values.images.pullPolicy }}
44 command: ["/opt/c3po/pcrf/pcrf-bootstrap.sh"]
45 volumeMounts:
46 - name: pcrf-script
47 mountPath: /opt/c3po/pcrf/pcrf-bootstrap.sh
48 subPath: pcrf-bootstrap.sh
49 {{- if .Values.config.coreDump.enabled }}
50{{ tuple "pcrf" . | include "omec-control-plane.coredump_init" | indent 6 }}
51 {{- end }}
52 containers:
53 - name: pcrf
54 image: {{ .Values.images.tags.pcrf }}
55 imagePullPolicy: {{ .Values.images.pullPolicy }}
56 {{- if .Values.config.coreDump.enabled }}
57 securityContext:
58 privileged: true
59 runAsUser: 0
60 {{- end }}
61 stdin: true
62 tty: true
63 command: ["bash", "-c", "/opt/c3po/pcrf/pcrf-run.sh"]
64 {{- if .Values.resources.enabled }}
65 resources:
66{{ toYaml .Values.resources.pcrf | indent 10 }}
67 {{- end }}
68 volumeMounts:
69 - name: pcrf-script
70 mountPath: /opt/c3po/pcrf/pcrf-run.sh
71 subPath: pcrf-run.sh
72 - name: pcrf-config
73 mountPath: /etc/pcrf/conf
74 {{- if .Values.config.coreDump.enabled }}
75 - name: coredump
76 mountPath: /tmp/coredump
77 {{- end }}
78 volumes:
79 - name: pcrf-script
80 configMap:
81 name: pcrf
82 defaultMode: 493
83 - name: pcrf-config
84 configMap:
85 name: pcrf
86 defaultMode: 420
87 {{- if .Values.config.coreDump.enabled }}
88 - name: host-rootfs
89 hostPath:
90 path: /
91 - name: coredump
92 hostPath:
93 path: {{ .Values.config.coreDump.path }}
94 {{- end }}
95{{- end }}