blob: 2a2098069a1576a310a6cc440bc14b8bbde1af8c [file] [log] [blame]
badhri854c028b32021-11-03 18:24:05 -05001{{/*
2# Copyright 2020-present Open Networking Foundation
3
4# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
5*/}}
6
7{{- if .Values.config.config4g.deploy }}
8{{ tuple "config4g" . | include "omec-control-plane.service_account" }}
9---
10apiVersion: apps/v1
11kind: StatefulSet
12metadata:
13 name: config4g
14 labels:
15{{ tuple "config4g" . | include "omec-control-plane.metadata_labels" | indent 4 }}
16spec:
17 replicas: 1
18 serviceName: config4g-headless
19 selector:
20 matchLabels:
21{{ tuple "config4g" . | include "omec-control-plane.metadata_labels" | indent 6 }}
22 template:
23 metadata:
24 labels:
25{{ tuple "config4g" . | include "omec-control-plane.metadata_labels" | indent 8 }}
26 {{- with .Values.config.config4g.podAnnotations }}
27 annotations:
28 {{- toYaml . | nindent 8 }}
29 {{- end }}
30 spec:
31 serviceAccountName: config4g
32 {{- if hasKey .Values.images "pullSecrets" }}
33 imagePullSecrets:
34{{ toYaml .Values.images.pullSecrets | indent 8 }}
35 {{- end }}
36 containers:
37 - name: config-4g
38 image: {{ .Values.images.tags.config4g }}
39 imagePullPolicy: {{ .Values.images.pullPolicy }}
40 {{- if .Values.config.coreDump.enabled }}
41 securityContext:
42 runAsUser: 0
43 {{- end }}
44 stdin: true
45 tty: true
46 command: ["/free5gc/script/config4g-run.sh"]
47 env:
48 - name: CONFIGPOD_DEPLOYMENT
49 value: "4G"
50 {{- if .Values.config.managedByConfigPod.enabled }}
51 - name: MANAGED_BY_CONFIG_POD
52 value: "true"
53 {{- end }}
54 {{- if .Values.resources.enabled }}
55 resources:
56{{ toYaml .Values.resources.config4g | indent 10 }}
57 {{- end }}
58 volumeMounts:
59 - name: run-script
60 mountPath: /free5gc/script/config4g-run.sh
61 subPath: config4g-run.sh
62 - name: nf-config
63 mountPath: /free5gc/config
64 {{- if .Values.config.coreDump.enabled }}
65 - name: coredump
66 mountPath: /tmp/coredump
67 {{- end }}
68 volumes:
69 - name: run-script
70 configMap:
71 name: config4g
72 defaultMode: 493
73 - name: nf-config
74 configMap:
75 name: config4g
76 defaultMode: 493
77 {{- if .Values.config.coreDump.enabled }}
78 - name: host-rootfs
79 hostPath:
80 path: /
81 - name: coredump
82 hostPath:
83 path: {{ .Values.config.coreDump.path }}
84 {{- end }}
85{{- end }}