badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 1 | {{/* |
| 2 | # Copyright 2020-present Open Networking Foundation |
| 3 | |
Ajay Lotan Thakur | 03189d2 | 2022-02-10 14:06:03 -0600 | [diff] [blame] | 4 | # SPDX-License-Identifier: Apache-2.0 |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 5 | */}} |
| 6 | |
| 7 | {{- if .Values.config.config4g.deploy }} |
| 8 | {{ tuple "config4g" . | include "omec-control-plane.service_account" }} |
| 9 | --- |
| 10 | apiVersion: apps/v1 |
| 11 | kind: StatefulSet |
| 12 | metadata: |
| 13 | name: config4g |
| 14 | labels: |
| 15 | {{ tuple "config4g" . | include "omec-control-plane.metadata_labels" | indent 4 }} |
| 16 | spec: |
| 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 |
Ajay Lotan Thakur | 71115fe | 2022-03-03 22:26:08 -0700 | [diff] [blame] | 38 | image: {{ .Values.images.repository }}{{ .Values.images.tags.config4g }} |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 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 }} |