blob: 2565d7b060dcb9b17530852e9673e1a6106b8c48 [file] [log] [blame]
Ajay Lotan Thakurefe5d8e2021-07-31 08:32:16 -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.resources.enabled }}
51 resources:
52{{ toYaml .Values.resources.config4g | indent 10 }}
53 {{- end }}
54 volumeMounts:
55 - name: run-script
56 mountPath: /free5gc/script/config4g-run.sh
57 subPath: config4g-run.sh
58 - name: nf-config
59 mountPath: /free5gc/config
60 {{- if .Values.config.coreDump.enabled }}
61 - name: coredump
62 mountPath: /tmp/coredump
63 {{- end }}
64 volumes:
65 - name: run-script
66 configMap:
67 name: config4g
68 defaultMode: 493
69 - name: nf-config
70 configMap:
71 name: config4g
72 defaultMode: 493
73 {{- if .Values.config.coreDump.enabled }}
74 - name: host-rootfs
75 hostPath:
76 path: /
77 - name: coredump
78 hostPath:
79 path: {{ .Values.config.coreDump.path }}
80 {{- end }}
81{{- end }}