Ajay Lotan Thakur | efe5d8e | 2021-07-31 08:32:16 -0500 | [diff] [blame] | 1 | {{/* |
| 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 | --- |
| 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 |
| 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: |
Ajay Lotan Thakur | 71f26c5 | 2021-08-19 17:04:02 -0500 | [diff] [blame] | 48 | - name: CONFIGPOD_DEPLOYMENT |
Ajay Lotan Thakur | efe5d8e | 2021-07-31 08:32:16 -0500 | [diff] [blame] | 49 | value: "4G" |
Ajay Lotan Thakur | 71f26c5 | 2021-08-19 17:04:02 -0500 | [diff] [blame] | 50 | {{- if .Values.config.managedByConfigPod.enabled }} |
| 51 | - name: MANAGED_BY_CONFIG_POD |
| 52 | value: "true" |
| 53 | {{- end }} |
Ajay Lotan Thakur | efe5d8e | 2021-07-31 08:32:16 -0500 | [diff] [blame] | 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 }} |