blob: 1ab53458956fce305b0bbed9a02fa802dd6cb722 [file] [log] [blame]
Badhrinath987e1d82020-11-20 13:23:58 -06001{{/*
2# Copyright 2020-present Open Networking Foundation
3
4# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
5*/}}
6
7{{- if .Values.config.pcf.deploy }}
8{{ tuple "pcf" . | include "5g-control-plane.service_account" }}
9---
10apiVersion: apps/v1
11kind: StatefulSet
12metadata:
13 name: pcf
14 labels:
15{{ tuple "pcf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
16spec:
17 replicas: 1
18 serviceName: pcf-headless
19 selector:
20 matchLabels:
21{{ tuple "pcf" . | include "5g-control-plane.metadata_labels" | indent 6 }}
22 template:
23 metadata:
24 labels:
25{{ tuple "pcf" . | include "5g-control-plane.metadata_labels" | indent 8 }}
26 {{- with .Values.config.pcf.podAnnotations }}
27 annotations:
28 {{- toYaml . | nindent 8 }}
29 {{- end }}
30 spec:
31 {{- if .Values.nodeSelectors.enabled }}
32 nodeSelector:
33 {{ .Values.nodeSelectors.pcf.label }}: {{ .Values.nodeSelectors.pcf.value }}
34 {{- end }}
35 serviceAccountName: pcf
36 {{- if .Values.images.credentials }}
37 imagePullSecrets:
38 - name: {{ .Release.Name }}.registry
39 {{- end }}
40 initContainers:
41 - name: wait-nrf-module
42 image: {{ .Values.images.tags.init | quote }}
43 imagePullPolicy: {{ .Values.images.pullPolicy }}
44 command: ['sh', '-c', 'until nslookup nrf; do echo waiting for nrf; sleep 4; done;']
45 {{- if .Values.config.coreDump.enabled }}
46{{ tuple "pcf" . | include "5g-control-plane.coredump_init" | indent 6 }}
47 {{- end }}
48 containers:
49 - name: pcf
50 image: {{ .Values.images.tags.pcf }}
51 imagePullPolicy: {{ .Values.images.pullPolicy }}
52 {{- if .Values.config.coreDump.enabled }}
53 securityContext:
54 runAsUser: 0
55 {{- end }}
56 stdin: true
57 tty: true
58 command: ["/opt/cp/scripts/pcf-run.sh"]
59 env:
60 - name: POD_IP
61 valueFrom:
62 fieldRef:
63 fieldPath: status.podIP
64 {{- if .Values.resources.enabled }}
65 resources:
66{{ toYaml .Values.resources.pcf | indent 10 }}
67 {{- end }}
68 volumeMounts:
69 - name: cp-script
70 mountPath: /opt/cp/scripts/pcf-run.sh
71 subPath: pcf-run.sh
72 - name: cp-config
73 mountPath: /free5gc/config
74 {{- if .Values.config.coreDump.enabled }}
75 - name: coredump
76 mountPath: /tmp/coredump
77 {{- end }}
78 volumes:
79 - name: cp-script
80 configMap:
81 name: pcf
82 defaultMode: 493
83 - name: cp-config
84 configMap:
85 name: pcf
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 }}