AETHER-1342 Improve 5gc-control-plane helm chart
- Add image pull secrets support
- Use Bitnami chart repo for MongoDB
- Use Deployment instead of Statefulset for the core components
- Add Ingress for WebUI
- Consolidate common configs to a single configmap
- Configure mongodb URL and name in a single place
- Remove unncessary test configs from default values
- Fix hard-coded URLs configurable
- Hide POD_IP from default values and enable auto-set
Change-Id: I58c9925cd8f3892ed59c386278d9ea5359e6b013
diff --git a/omec/5g-control-plane/templates/deployment-nssf.yaml b/omec/5g-control-plane/templates/deployment-nssf.yaml
new file mode 100644
index 0000000..f404f1a
--- /dev/null
+++ b/omec/5g-control-plane/templates/deployment-nssf.yaml
@@ -0,0 +1,103 @@
+{{/*
+# Copyright 2020-present Open Networking Foundation
+
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+{{- if .Values.config.nssf.deploy }}
+{{ tuple "nssf" . | include "5g-control-plane.service_account" }}
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: nssf
+ labels:
+{{ tuple "nssf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
+spec:
+ replicas: 1
+ #serviceName: nssf-headless
+ selector:
+ matchLabels:
+{{ tuple "nssf" . | include "5g-control-plane.metadata_labels" | indent 6 }}
+ template:
+ metadata:
+ labels:
+{{ tuple "nssf" . | include "5g-control-plane.metadata_labels" | indent 8 }}
+ {{- with .Values.config.nssf.podAnnotations }}
+ annotations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ spec:
+ serviceAccountName: nssf
+ {{- if hasKey .Values.images "pullSecrets" }}
+ imagePullSecrets:
+{{ toYaml .Values.images.pullSecrets | indent 8 }}
+ {{- end }}
+ initContainers:
+ - name: wait-nssf-module
+ image: {{ .Values.images.tags.init | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ command: ['sh', '-c', 'until nslookup nssf; do echo waiting for nssf; sleep 4; done;']
+ {{- if .Values.config.coreDump.enabled }}
+{{ tuple "nssf" . | include "5g-control-plane.coredump_init" | indent 6 }}
+ {{- end }}
+ containers:
+ - name: nssf
+ image: {{ .Values.images.tags.nssf }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ {{- if .Values.config.coreDump.enabled }}
+ securityContext:
+ runAsUser: 0
+ {{- end }}
+ stdin: true
+ tty: true
+ command: ["/free5gc/script/nssf-run.sh"]
+ env:
+ - name: POD_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.nssf | indent 10 }}
+ {{- end }}
+ volumeMounts:
+ - name: run-script
+ mountPath: /free5gc/script/nssf-run.sh
+ subPath: nssf-run.sh
+ - name: config-dir
+ mountPath: /free5gc/config
+ - name: common-config
+ mountPath: /tmp/config/free5GC.conf
+ subPath: free5GC.conf
+ - name: nf-config
+ mountPath: /tmp/config/nssfcfg.conf
+ subPath: nssfcfg.conf
+ {{- if .Values.config.coreDump.enabled }}
+ - name: coredump
+ mountPath: /tmp/coredump
+ {{- end }}
+ volumes:
+ - name: run-script
+ configMap:
+ name: nssf
+ defaultMode: 493
+ - name: common-config
+ configMap:
+ name: common
+ defaultMode: 493
+ - name: nf-config
+ configMap:
+ name: nssf
+ defaultMode: 493
+ - name: config-dir
+ emptyDir: {}
+ {{- if .Values.config.coreDump.enabled }}
+ - name: host-rootfs
+ hostPath:
+ path: /
+ - name: coredump
+ hostPath:
+ path: {{ .Values.config.coreDump.path }}
+ {{- end }}
+{{- end }}