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/bin/_amf-run.sh.tpl b/omec/5g-control-plane/templates/bin/_amf-run.sh.tpl
index 07c6de7..4a2f3f6 100644
--- a/omec/5g-control-plane/templates/bin/_amf-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_amf-run.sh.tpl
@@ -10,14 +10,11 @@
 cp /free5gc/amf/amf /tmp/coredump/
 {{- end }}
 
-#cat config files
-
 cd /free5gc
-cat ./config/free5GC.conf
-cat ./config/amfcfg.conf
-cat /etc/hosts
-cp /free5gc/config/amfcfg.conf /tmp/amfcfg.conf
-sed -i "s/POD_IP/${POD_IP}/g" /tmp/amfcfg.conf
-NRF_ADDR=$(dig +short nrf.omec.svc.cluster.local)
-sed -i "s/nrf.free5gc.org/${NRF_ADDR}/g" /tmp/amfcfg.conf
-./amf/amf -amfcfg /tmp/amfcfg.conf 
+cp /tmp/config/* config/
+sed -i "s/POD_IP/${POD_IP}/g" config/amfcfg.conf
+
+cat config/free5GC.conf
+cat config/amfcfg.conf
+
+./amf/amf -amfcfg config/amfcfg.conf
diff --git a/omec/5g-control-plane/templates/bin/_ausf-run.sh.tpl b/omec/5g-control-plane/templates/bin/_ausf-run.sh.tpl
index 9273615..f97bd8e 100644
--- a/omec/5g-control-plane/templates/bin/_ausf-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_ausf-run.sh.tpl
@@ -10,13 +10,11 @@
 cp /free5gc/ausf/ausf /tmp/coredump/
 {{- end }}
 
-
 cd /free5gc
-#print config files
-cat ./config/free5GC.conf
-cat ./config/ausfcfg.conf
-cp /free5gc/config/ausfcfg.conf /tmp/ausfcfg.conf
-sed -i "s/POD_IP/${POD_IP}/g" /tmp/ausfcfg.conf
-NRF_ADDR=$(dig +short nrf.omec.svc.cluster.local)
-sed -i "s/nrf.free5gc.org/${NRF_ADDR}/g" /tmp/ausfcfg.conf
-./ausf/ausf -ausfcfg /tmp/ausfcfg.conf
+cp /tmp/config/* config/
+sed -i "s/POD_IP/${POD_IP}/g" config/ausfcfg.conf
+
+cat config/free5GC.conf
+cat config/ausfcfg.conf
+
+./ausf/ausf -ausfcfg config/ausfcfg.conf
\ No newline at end of file
diff --git a/omec/5g-control-plane/templates/bin/_nrf-run.sh.tpl b/omec/5g-control-plane/templates/bin/_nrf-run.sh.tpl
index af38ace..d3205ea 100644
--- a/omec/5g-control-plane/templates/bin/_nrf-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_nrf-run.sh.tpl
@@ -10,13 +10,11 @@
 cp /free5gc/nrf/nrf /tmp/coredump/
 {{- end }}
 
-#cat config files
-
 cd /free5gc
-cat ./config/free5GC.conf
-cat ./config/nrfcfg.conf
-cat /etc/hosts
-cp /free5gc/config/nrfcfg.conf /tmp/nrfcfg.conf
-sed -i "s/nrf.free5gc.org/${POD_IP}/g" /tmp/nrfcfg.conf
-sed -i "s/POD_IP/${POD_IP}/g" /tmp/nrfcfg.conf
-./nrf/nrf -nrfcfg /tmp/nrfcfg.conf
+cp /tmp/config/* config/
+sed -i "s/POD_IP/${POD_IP}/g" config/nrfcfg.conf
+
+cat config/free5GC.conf
+cat config/nrfcfg.conf
+
+./nrf/nrf -nrfcfg config/nrfcfg.conf
diff --git a/omec/5g-control-plane/templates/bin/_nssf-run.sh.tpl b/omec/5g-control-plane/templates/bin/_nssf-run.sh.tpl
index 04247eb..873df5c 100644
--- a/omec/5g-control-plane/templates/bin/_nssf-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_nssf-run.sh.tpl
@@ -10,14 +10,11 @@
 cp /free5gc/nssf/nssf /tmp/coredump/
 {{- end }}
 
-#cat config files
-
 cd /free5gc
-cat ./config/free5GC.conf
-cat ./config/nssfcfg.conf
-cat /etc/hosts
-cp /free5gc/config/nssfcfg.conf /tmp/nssfcfg.conf
-sed -i "s/POD_IP/${POD_IP}/g" /tmp/nssfcfg.conf
-NRF_ADDR=$(dig +short nrf.omec.svc.cluster.local)
-sed -i "s/nrf.free5gc.org/${NRF_ADDR}/g" /tmp/nssfcfg.conf
-./nssf/nssf -nssfcfg /tmp/nssfcfg.conf 
+cp /tmp/config/* config/
+sed -i "s/POD_IP/${POD_IP}/g" config/nssfcfg.conf
+
+cat config/free5GC.conf
+cat config/nssfcfg.conf
+
+./nssf/nssf -nssfcfg config/nssfcfg.conf
diff --git a/omec/5g-control-plane/templates/bin/_pcf-run.sh.tpl b/omec/5g-control-plane/templates/bin/_pcf-run.sh.tpl
index 1d11de4..b47eb21 100644
--- a/omec/5g-control-plane/templates/bin/_pcf-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_pcf-run.sh.tpl
@@ -10,14 +10,11 @@
 cp /free5gc/pcf/pcf /tmp/coredump/
 {{- end }}
 
-#cat config files
-
 cd /free5gc
-cat ./config/free5GC.conf
-cat ./config/pcfcfg.conf
-cat /etc/hosts
-cp /free5gc/config/pcfcfg.conf /tmp/pcfcfg.conf
-sed -i "s/POD_IP/${POD_IP}/g" /tmp/pcfcfg.conf
-NRF_ADDR=$(dig +short nrf.omec.svc.cluster.local)
-sed -i "s/nrf.free5gc.org/${NRF_ADDR}/g" /tmp/pcfcfg.conf
-./pcf/pcf -pcfcfg /tmp/pcfcfg.conf 
+cp /tmp/config/* config/
+sed -i "s/POD_IP/${POD_IP}/g" config/pcfcfg.conf
+
+cat config/free5GC.conf
+cat config/pcfcfg.conf
+
+./pcf/pcf -pcfcfg config/pcfcfg.conf
diff --git a/omec/5g-control-plane/templates/bin/_smf-run.sh.tpl b/omec/5g-control-plane/templates/bin/_smf-run.sh.tpl
index f4b95b9..9d5bcf6 100644
--- a/omec/5g-control-plane/templates/bin/_smf-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_smf-run.sh.tpl
@@ -10,15 +10,12 @@
 cp /free5gc/smf/smf /tmp/coredump/
 {{- end }}
 
-#cat config files
-
 cd /free5gc
-cat ./config/free5GC.conf
-cat ./config/smfcfg.conf
-cat ./config/uerouting.yaml
-cat /etc/hosts
-cp /free5gc/config/smfcfg.conf /tmp/smfcfg.conf
-sed -i "s/POD_IP/${POD_IP}/g" /tmp/smfcfg.conf
-NRF_ADDR=$(dig +short nrf.omec.svc.cluster.local)
-sed -i "s/nrf.free5gc.org/${NRF_ADDR}/g" /tmp/smfcfg.conf
-./smf/smf -smfcfg /tmp/smfcfg.conf -uerouting ./config/uerouting.yaml
+cp /tmp/config/* config/
+sed -i "s/POD_IP/${POD_IP}/g" config/smfcfg.conf
+
+cat config/free5GC.conf
+cat config/smfcfg.conf
+cat config/uerouting.conf
+
+./smf/smf -smfcfg config/smfcfg.conf -uerouting config/uerouting.conf
diff --git a/omec/5g-control-plane/templates/bin/_udm-run.sh.tpl b/omec/5g-control-plane/templates/bin/_udm-run.sh.tpl
index 617d868..9ad07f5 100644
--- a/omec/5g-control-plane/templates/bin/_udm-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_udm-run.sh.tpl
@@ -10,14 +10,11 @@
 cp /free5gc/udm/udm /tmp/coredump/
 {{- end }}
 
-#cat config files
-
 cd /free5gc
-cat ./config/free5GC.conf
-cat ./config/udmcfg.conf
-cat /etc/hosts
-cp /free5gc/config/udmcfg.conf /tmp/udmcfg.conf
-sed -i "s/POD_IP/${POD_IP}/g" /tmp/udmcfg.conf
-NRF_ADDR=$(dig +short nrf.omec.svc.cluster.local)
-sed -i "s/nrf.free5gc.org/${NRF_ADDR}/g" /tmp/udmcfg.conf
-./udm/udm -udmcfg /tmp/udmcfg.conf 
+cp /tmp/config/* config/
+sed -i "s/POD_IP/${POD_IP}/g" config/udmcfg.conf
+
+cat config/free5GC.conf
+cat config/udmcfg.conf
+
+./udm/udm -udmcfg config/udmcfg.conf
diff --git a/omec/5g-control-plane/templates/bin/_udr-run.sh.tpl b/omec/5g-control-plane/templates/bin/_udr-run.sh.tpl
index dee769c..5140888 100644
--- a/omec/5g-control-plane/templates/bin/_udr-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_udr-run.sh.tpl
@@ -10,14 +10,11 @@
 cp /free5gc/udr/udr /tmp/coredump/
 {{- end }}
 
-#cat config files
-
 cd /free5gc
-cat ./config/free5GC.conf
-cat ./config/udrcfg.conf
-cat /etc/hosts
-cp /free5gc/config/udrcfg.conf /tmp/udrcfg.conf
-sed -i "s/POD_IP/${POD_IP}/g" /tmp/udrcfg.conf
-NRF_ADDR=$(dig +short nrf.omec.svc.cluster.local)
-sed -i "s/nrf.free5gc.org/${NRF_ADDR}/g" /tmp/udrcfg.conf
-./udr/udr -udrcfg /tmp/udrcfg.conf 
+cp /tmp/config/* config/
+sed -i "s/POD_IP/${POD_IP}/g" config/udrcfg.conf
+
+cat config/free5GC.conf
+cat config/udrcfg.conf
+
+./udr/udr -udrcfg config/udrcfg.conf
diff --git a/omec/5g-control-plane/templates/bin/_webui-run.sh.tpl b/omec/5g-control-plane/templates/bin/_webui-run.sh.tpl
index 1309bb6..2cefce4 100644
--- a/omec/5g-control-plane/templates/bin/_webui-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_webui-run.sh.tpl
@@ -10,13 +10,10 @@
 cp /free5gc/webconsole/webui /tmp/coredump/
 {{- end }}
 
-#cat config files
-
 cd /free5gc
-cat ./config/free5GC.conf
-cat ./config/webuicfg.conf
-cat /etc/hosts
-cp /free5gc/config/webuicfg.conf /tmp/webuicfg.conf
-NRF_ADDR=$(dig +short nrf.omec.svc.cluster.local)
-sed -i "s/nrf.free5gc.org/${NRF_ADDR}/g" /tmp/webuicfg.conf
-./webconsole/webui 
+cp /tmp/config/* config/
+
+cat config/free5GC.conf
+cat config/webuicfg.conf
+
+./webconsole/webui -webuicfg config/webuicfg.conf
diff --git a/omec/5g-control-plane/templates/configmap-amf.yaml b/omec/5g-control-plane/templates/configmap-amf.yaml
index 617818e..d731378 100644
--- a/omec/5g-control-plane/templates/configmap-amf.yaml
+++ b/omec/5g-control-plane/templates/configmap-amf.yaml
@@ -5,6 +5,24 @@
 */}}
 
 {{- if .Values.config.amf.deploy }}
+
+{{- $amfcfg := index .Values.config.amf.cfgFiles "amfcfg.conf" }}
+{{- $sbi := index $amfcfg.configuration "sbi" }}
+
+{{- if not (hasKey $sbi "registerIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "registerIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "bindingIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "bindingIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "port") -}}
+{{- $_ := .Values.config.amf.sbi.port | set $sbi "port" -}}
+{{- end }}
+
+{{- if not (hasKey $amfcfg.configuration "ngapIpList") -}}
+{{- $_ := list "POD_IP" | set $amfcfg.configuration "ngapIpList" -}}
+{{- end }}
+
 ---
 apiVersion: v1
 kind: ConfigMap
@@ -15,7 +33,7 @@
 data:
   amf-run.sh: |
 {{ tuple "bin/_amf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
-{{- range $key, $value := .Values.config.amf.yamlCfgFiles }}
+{{- range $key, $value := .Values.config.amf.cfgFiles }}
   {{ $key }}: |-
 {{ toYaml $value | indent 4 }}
 {{- end }}
diff --git a/omec/5g-control-plane/templates/configmap-ausf.yaml b/omec/5g-control-plane/templates/configmap-ausf.yaml
index 5dc0f98..efb0581 100644
--- a/omec/5g-control-plane/templates/configmap-ausf.yaml
+++ b/omec/5g-control-plane/templates/configmap-ausf.yaml
@@ -5,6 +5,20 @@
 */}}
 
 {{- if .Values.config.ausf.deploy }}
+
+{{- $ausfcfg := index .Values.config.ausf.cfgFiles "ausfcfg.conf" }}
+{{- $sbi := index $ausfcfg.configuration "sbi" }}
+
+{{- if not (hasKey $sbi "registerIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "registerIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "bindingIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "bindingIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "port") -}}
+{{- $_ := .Values.config.ausf.sbi.port | set $sbi "port" -}}
+{{- end }}
+
 ---
 apiVersion: v1
 kind: ConfigMap
@@ -15,7 +29,7 @@
 data:
   ausf-run.sh: |
 {{ tuple "bin/_ausf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
-{{- range $key, $value := .Values.config.ausf.yamlCfgFiles }}
+{{- range $key, $value := .Values.config.ausf.cfgFiles }}
   {{ $key }}: |-
 {{ toYaml $value | indent 4 }}
 {{- end }}
diff --git a/omec/5g-control-plane/templates/configmap-common.yaml b/omec/5g-control-plane/templates/configmap-common.yaml
new file mode 100644
index 0000000..0b13efb
--- /dev/null
+++ b/omec/5g-control-plane/templates/configmap-common.yaml
@@ -0,0 +1,23 @@
+{{/*
+# Copyright 2020-present Open Networking Foundation
+
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+{{- $config := index .Values.config.commonCfgFiles "free5GC.conf" }}
+{{- if not (hasKey $config "db_uri") -}}
+{{- $_ := printf "%s/%s" .Values.config.mongodb.url .Values.config.mongodb.name | set $config "db_uri" -}}
+{{- end }}
+
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: common
+  labels:
+{{ tuple "common" . | include "5g-control-plane.metadata_labels" | indent 4 }}
+data:
+{{- range $key, $value := .Values.config.commonCfgFiles }}
+  {{ $key }}: |-
+{{ toYaml $value | indent 4 }}
+{{- end }}
diff --git a/omec/5g-control-plane/templates/configmap-nrf.yaml b/omec/5g-control-plane/templates/configmap-nrf.yaml
index bc15b65..da24f20 100644
--- a/omec/5g-control-plane/templates/configmap-nrf.yaml
+++ b/omec/5g-control-plane/templates/configmap-nrf.yaml
@@ -5,6 +5,31 @@
 */}}
 
 {{- if .Values.config.nrf.deploy }}
+
+{{- $nrfcfg := index .Values.config.nrf.cfgFiles "nrfcfg.conf" }}
+{{- $config := index $nrfcfg "configuration" }}
+{{- $sbi := index $config "sbi" }}
+
+{{- if not (hasKey $config "MongoDBName") -}}
+{{- $_ := .Values.config.mongodb.name | set $config "MongoDBName" -}}
+{{- end }}
+{{- if not (hasKey $config "MongoDBUrl") -}}
+{{- $_ := .Values.config.mongodb.url | set $config "MongoDBUrl" -}}
+{{- end }}
+{{- if not (hasKey $config "DefaultServiceIP") -}}
+{{- $_ := "POD_IP" | set $config "DefaultServiceIP" -}}
+{{- end }}
+
+{{- if not (hasKey $sbi "registerIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "registerIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "bindingIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "bindingIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "port") -}}
+{{- $_ := .Values.config.nrf.sbi.port | set $sbi "port" -}}
+{{- end }}
+
 ---
 apiVersion: v1
 kind: ConfigMap
@@ -15,7 +40,7 @@
 data:
   nrf-run.sh: |
 {{ tuple "bin/_nrf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
-{{- range $key, $value := .Values.config.nrf.yamlCfgFiles }}
+{{- range $key, $value := .Values.config.nrf.cfgFiles }}
   {{ $key }}: |-
 {{ toYaml $value | indent 4 }}
 {{- end }}
diff --git a/omec/5g-control-plane/templates/configmap-nssf.yaml b/omec/5g-control-plane/templates/configmap-nssf.yaml
index f0e3193..20e3e69 100644
--- a/omec/5g-control-plane/templates/configmap-nssf.yaml
+++ b/omec/5g-control-plane/templates/configmap-nssf.yaml
@@ -5,6 +5,20 @@
 */}}
 
 {{- if .Values.config.nssf.deploy }}
+
+{{- $nssfcfg := index .Values.config.nssf.cfgFiles "nssfcfg.conf" }}
+{{- $sbi := index $nssfcfg.configuration "sbi" }}
+
+{{- if not (hasKey $sbi "registerIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "registerIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "bindingIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "bindingIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "port") -}}
+{{- $_ := .Values.config.nssf.sbi.port | set $sbi "port" -}}
+{{- end }}
+
 ---
 apiVersion: v1
 kind: ConfigMap
@@ -15,7 +29,7 @@
 data:
   nssf-run.sh: |
 {{ tuple "bin/_nssf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
-{{- range $key, $value := .Values.config.nssf.yamlCfgFiles }}
+{{- range $key, $value := .Values.config.nssf.cfgFiles }}
   {{ $key }}: |-
 {{ toYaml $value | indent 4 }}
 {{- end }}
diff --git a/omec/5g-control-plane/templates/configmap-pcf.yaml b/omec/5g-control-plane/templates/configmap-pcf.yaml
index 2fc4dd7..9d5147c 100644
--- a/omec/5g-control-plane/templates/configmap-pcf.yaml
+++ b/omec/5g-control-plane/templates/configmap-pcf.yaml
@@ -5,6 +5,20 @@
 */}}
 
 {{- if .Values.config.pcf.deploy }}
+
+{{- $pcfcfg := index .Values.config.pcf.cfgFiles "pcfcfg.conf" }}
+{{- $sbi := index $pcfcfg.configuration "sbi" }}
+
+{{- if not (hasKey $sbi "registerIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "registerIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "bindingIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "bindingIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "port") -}}
+{{- $_ := .Values.config.pcf.sbi.port | set $sbi "port" -}}
+{{- end }}
+
 ---
 apiVersion: v1
 kind: ConfigMap
@@ -15,7 +29,7 @@
 data:
   pcf-run.sh: |
 {{ tuple "bin/_pcf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
-{{- range $key, $value := .Values.config.pcf.yamlCfgFiles }}
+{{- range $key, $value := .Values.config.pcf.cfgFiles }}
   {{ $key }}: |-
 {{ toYaml $value | indent 4 }}
 {{- end }}
diff --git a/omec/5g-control-plane/templates/configmap-smf.yaml b/omec/5g-control-plane/templates/configmap-smf.yaml
index b1261ff..e5400bf 100644
--- a/omec/5g-control-plane/templates/configmap-smf.yaml
+++ b/omec/5g-control-plane/templates/configmap-smf.yaml
@@ -5,6 +5,23 @@
 */}}
 
 {{- if .Values.config.smf.deploy }}
+
+{{- $smfcfg := index .Values.config.smf.cfgFiles "smfcfg.conf" }}
+{{- $sbi := index $smfcfg.configuration "sbi" }}
+
+{{- if not (hasKey $smfcfg.configuration "pfcp") -}}
+{{- $_ := dict "addr" "POD_IP" | set $smfcfg.configuration "pfcp" -}}
+{{- end }}
+{{- if not (hasKey $sbi "registerIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "registerIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "bindingIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "bindingIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "port") -}}
+{{- $_ := .Values.config.smf.sbi.port | set $sbi "port" -}}
+{{- end }}
+
 ---
 apiVersion: v1
 kind: ConfigMap
@@ -15,7 +32,7 @@
 data:
   smf-run.sh: |
 {{ tuple "bin/_smf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
-{{- range $key, $value := .Values.config.smf.yamlCfgFiles }}
+{{- range $key, $value := .Values.config.smf.cfgFiles }}
   {{ $key }}: |-
 {{ toYaml $value | indent 4 }}
 {{- end }}
diff --git a/omec/5g-control-plane/templates/configmap-udm.yaml b/omec/5g-control-plane/templates/configmap-udm.yaml
index 5c2a3df..1fcf9ae 100644
--- a/omec/5g-control-plane/templates/configmap-udm.yaml
+++ b/omec/5g-control-plane/templates/configmap-udm.yaml
@@ -5,6 +5,20 @@
 */}}
 
 {{- if .Values.config.udm.deploy }}
+
+{{- $udmcfg := index .Values.config.udm.cfgFiles "udmcfg.conf" }}
+{{- $sbi := index $udmcfg.configuration "sbi" }}
+
+{{- if not (hasKey $sbi "registerIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "registerIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "bindingIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "bindingIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "port") -}}
+{{- $_ := .Values.config.udm.sbi.port | set $sbi "port" -}}
+{{- end }}
+
 ---
 apiVersion: v1
 kind: ConfigMap
@@ -15,7 +29,7 @@
 data:
   udm-run.sh: |
 {{ tuple "bin/_udm-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
-{{- range $key, $value := .Values.config.udm.yamlCfgFiles }}
+{{- range $key, $value := .Values.config.udm.cfgFiles }}
   {{ $key }}: |-
 {{ toYaml $value | indent 4 }}
 {{- end }}
diff --git a/omec/5g-control-plane/templates/configmap-udr.yaml b/omec/5g-control-plane/templates/configmap-udr.yaml
index 667b23d..3508ac3 100644
--- a/omec/5g-control-plane/templates/configmap-udr.yaml
+++ b/omec/5g-control-plane/templates/configmap-udr.yaml
@@ -5,6 +5,25 @@
 */}}
 
 {{- if .Values.config.udr.deploy }}
+
+{{- $udrcfg := index .Values.config.udr.cfgFiles "udrcfg.conf" }}
+{{- $config := index $udrcfg "configuration" }}
+{{- $sbi := index $config "sbi" }}
+
+{{- if not (hasKey $config "mongodb") -}}
+{{- $_ := dict "name" .Values.config.mongodb.name "url" .Values.config.mongodb.url | set $config "mongodb" -}}
+{{- end }}
+
+{{- if not (hasKey $sbi "registerIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "registerIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "bindingIPv4") -}}
+{{- $_ := "POD_IP" | set $sbi "bindingIPv4" -}}
+{{- end }}
+{{- if not (hasKey $sbi "port") -}}
+{{- $_ := .Values.config.udr.sbi.port | set $sbi "port" -}}
+{{- end }}
+
 ---
 apiVersion: v1
 kind: ConfigMap
@@ -15,7 +34,7 @@
 data:
   udr-run.sh: |
 {{ tuple "bin/_udr-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
-{{- range $key, $value := .Values.config.udr.yamlCfgFiles }}
+{{- range $key, $value := .Values.config.udr.cfgFiles }}
   {{ $key }}: |-
 {{ toYaml $value | indent 4 }}
 {{- end }}
diff --git a/omec/5g-control-plane/templates/configmap-webui.yaml b/omec/5g-control-plane/templates/configmap-webui.yaml
index 9197644..14657ed 100644
--- a/omec/5g-control-plane/templates/configmap-webui.yaml
+++ b/omec/5g-control-plane/templates/configmap-webui.yaml
@@ -5,6 +5,13 @@
 */}}
 
 {{- if .Values.config.webui.deploy }}
+
+{{- $webuicfg := index .Values.config.webui.cfgFiles "webuicfg.conf" }}
+{{- $config := index $webuicfg "configuration" }}
+{{- if not (hasKey $config "mongodb") -}}
+{{- $_ := dict "name" .Values.config.mongodb.name "url" .Values.config.mongodb.url | set $config "mongodb" -}}
+{{- end }}
+
 ---
 apiVersion: v1
 kind: ConfigMap
@@ -15,7 +22,7 @@
 data:
   webui-run.sh: |
 {{ tuple "bin/_webui-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
-{{- range $key, $value := .Values.config.webui.yamlCfgFiles }}
+{{- range $key, $value := .Values.config.webui.cfgFiles }}
   {{ $key }}: |-
 {{ toYaml $value | indent 4 }}
 {{- end }}
diff --git a/omec/5g-control-plane/templates/statefulset-amf.yaml b/omec/5g-control-plane/templates/deployment-amf.yaml
similarity index 75%
rename from omec/5g-control-plane/templates/statefulset-amf.yaml
rename to omec/5g-control-plane/templates/deployment-amf.yaml
index b410e4a..e800c05 100644
--- a/omec/5g-control-plane/templates/statefulset-amf.yaml
+++ b/omec/5g-control-plane/templates/deployment-amf.yaml
@@ -8,14 +8,14 @@
 {{ tuple "amf" . | include "5g-control-plane.service_account" }}
 ---
 apiVersion: apps/v1
-kind: StatefulSet
+kind: Deployment
 metadata:
   name: amf
   labels:
 {{ tuple "amf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 spec:
   replicas: 1
-  serviceName: amf-headless
+  #serviceName: amf-headless
   selector:
     matchLabels:
 {{ tuple "amf" . | include "5g-control-plane.metadata_labels" | indent 6 }}
@@ -28,14 +28,10 @@
         {{- toYaml . | nindent 8 }}
     {{- end }}
     spec:
-    {{- if .Values.nodeSelectors.enabled }}
-      nodeSelector:
-        {{ .Values.nodeSelectors.amf.label }}: {{ .Values.nodeSelectors.amf.value }}
-    {{- end }}
       serviceAccountName: amf
-    {{- if .Values.images.credentials }}
+    {{- if hasKey .Values.images "pullSecrets" }}
       imagePullSecrets:
-        - name: {{ .Release.Name }}.registry
+{{ toYaml .Values.images.pullSecrets | indent 8 }}
     {{- end }}
       initContainers:
       - name: wait-nrf-module
@@ -55,7 +51,7 @@
       {{- end }}
         stdin: true
         tty: true
-        command: ["/opt/cp/scripts/amf-run.sh"]
+        command: ["/free5gc/script/amf-run.sh"]
         env:
         - name: POD_IP
           valueFrom:
@@ -66,24 +62,36 @@
 {{ toYaml .Values.resources.amf | indent 10 }}
       {{- end }}
         volumeMounts:
-        - name: cp-script
-          mountPath: /opt/cp/scripts/amf-run.sh
+        - name: run-script
+          mountPath: /free5gc/script/amf-run.sh
           subPath: amf-run.sh
-        - name: cp-config
+        - name: config-dir
           mountPath: /free5gc/config
+        - name: common-config
+          mountPath: /tmp/config/free5GC.conf
+          subPath: free5GC.conf
+        - name: nf-config
+          mountPath: /tmp/config/amfcfg.conf
+          subPath: amfcfg.conf
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
       {{- end }}
       volumes:
-      - name: cp-script
+      - name: run-script
         configMap:
           name: amf
           defaultMode: 493
-      - name: cp-config
+      - name: common-config
+        configMap:
+          name: common
+          defaultMode: 493 
+      - name: nf-config
         configMap:
           name: amf
-          defaultMode: 420
+          defaultMode: 493
+      - name: config-dir
+        emptyDir: {}
     {{- if .Values.config.coreDump.enabled }}
       - name: host-rootfs
         hostPath:
diff --git a/omec/5g-control-plane/templates/statefulset-ausf.yaml b/omec/5g-control-plane/templates/deployment-ausf.yaml
similarity index 72%
rename from omec/5g-control-plane/templates/statefulset-ausf.yaml
rename to omec/5g-control-plane/templates/deployment-ausf.yaml
index 2293c3b..f27c0fb 100644
--- a/omec/5g-control-plane/templates/statefulset-ausf.yaml
+++ b/omec/5g-control-plane/templates/deployment-ausf.yaml
@@ -8,14 +8,14 @@
 {{ tuple "ausf" . | include "5g-control-plane.service_account" }}
 ---
 apiVersion: apps/v1
-kind: StatefulSet
+kind: Deployment
 metadata:
   name: ausf
   labels:
 {{ tuple "ausf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 spec:
   replicas: 1
-  serviceName: ausf-headless
+  #serviceName: ausf-headless
   selector:
     matchLabels:
 {{ tuple "ausf" . | include "5g-control-plane.metadata_labels" | indent 6 }}
@@ -30,20 +30,16 @@
         {{- toYaml . | nindent 8 }}
     {{- end }}
     spec:
-    {{- if .Values.nodeSelectors.enabled }}
-      nodeSelector:
-        {{ .Values.nodeSelectors.ausf.label }}: {{ .Values.nodeSelectors.ausf.value }}
-    {{- end }}
       serviceAccountName: ausf
-    {{- if .Values.images.credentials }}
+    {{- if hasKey .Values.images "pullSecrets" }}
       imagePullSecrets:
-        - name: {{ .Release.Name }}.registry
+{{ toYaml .Values.images.pullSecrets | indent 8 }}
     {{- end }}
       initContainers:
-      - name: wait-nrf-module2
+      - name: wait-ausf-module2
         image: {{ .Values.images.tags.init | quote }}
         imagePullPolicy: {{ .Values.images.pullPolicy }}
-        command: ['sh', '-c', 'until nslookup nrf; do echo waiting for nrf; sleep 4; done;']
+        command: ['sh', '-c', 'until nslookup ausf; do echo waiting for ausf; sleep 4; done;']
     {{- if .Values.config.coreDump.enabled }}
 {{ tuple "ausf" . | include "5g-control-plane.coredump_init" | indent 6 }}
     {{- end }}
@@ -57,7 +53,7 @@
       {{- end }}
         stdin: true
         tty: true
-        command: ["/opt/cp/scripts/ausf-run.sh"]
+        command: ["/free5gc/script/ausf-run.sh"]
         env:
         - name: POD_IP
           valueFrom:
@@ -68,24 +64,36 @@
 {{ toYaml .Values.resources.ausf | indent 10 }}
       {{- end }}
         volumeMounts:
-        - name: cp-script
-          mountPath: /opt/cp/scripts/ausf-run.sh
+        - name: run-script
+          mountPath: /free5gc/script/ausf-run.sh
           subPath: ausf-run.sh
-        - name: cp-config
+        - name: config-dir
           mountPath: /free5gc/config
+        - name: common-config
+          mountPath: /tmp/config/free5GC.conf
+          subPath: free5GC.conf
+        - name: nf-config
+          mountPath: /tmp/config/ausfcfg.conf
+          subPath: ausfcfg.conf
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
       {{- end }}
       volumes:
-      - name: cp-script
+      - name: run-script
         configMap:
           name: ausf
           defaultMode: 493
-      - name: cp-config
+      - name: common-config
+        configMap:
+          name: common
+          defaultMode: 493 
+      - name: nf-config
         configMap:
           name: ausf
-          defaultMode: 420
+          defaultMode: 493
+      - name: config-dir
+        emptyDir: {}
     {{- if .Values.config.coreDump.enabled }}
       - name: host-rootfs
         hostPath:
diff --git a/omec/5g-control-plane/templates/statefulset-nrf.yaml b/omec/5g-control-plane/templates/deployment-nrf.yaml
similarity index 75%
rename from omec/5g-control-plane/templates/statefulset-nrf.yaml
rename to omec/5g-control-plane/templates/deployment-nrf.yaml
index 44683f8..738e1e0 100644
--- a/omec/5g-control-plane/templates/statefulset-nrf.yaml
+++ b/omec/5g-control-plane/templates/deployment-nrf.yaml
@@ -8,14 +8,14 @@
 {{ tuple "nrf" . | include "5g-control-plane.service_account" }}
 ---
 apiVersion: apps/v1
-kind: StatefulSet
+kind: Deployment
 metadata:
   name: nrf
   labels:
 {{ tuple "nrf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 spec:
   replicas: 1
-  serviceName: nrf-headless
+  #serviceName: nrf-headless
   selector:
     matchLabels:
 {{ tuple "nrf" . | include "5g-control-plane.metadata_labels" | indent 6 }}
@@ -30,14 +30,10 @@
         {{- toYaml . | nindent 8 }}
     {{- end }}
     spec:
-    {{- if .Values.nodeSelectors.enabled }}
-      nodeSelector:
-        {{ .Values.nodeSelectors.nrf.label }}: {{ .Values.nodeSelectors.nrf.value }}
-    {{- end }}
       serviceAccountName: nrf
-    {{- if .Values.images.credentials }}
+    {{- if hasKey .Values.images "pullSecrets" }}
       imagePullSecrets:
-        - name: {{ .Release.Name }}.registry
+{{ toYaml .Values.images.pullSecrets | indent 8 }}
     {{- end }}
     {{- if .Values.config.coreDump.enabled }}
       initContainers:
@@ -53,7 +49,7 @@
       {{- end }}
         stdin: true
         tty: true
-        command: ["/opt/cp/scripts/nrf-run.sh"]
+        command: ["/free5gc/script/nrf-run.sh"]
         env:
         - name: POD_IP
           valueFrom:
@@ -64,24 +60,36 @@
 {{ toYaml .Values.resources.nrf | indent 10 }}
       {{- end }}
         volumeMounts:
-        - name: cp-script
-          mountPath: /opt/cp/scripts/nrf-run.sh
+        - name: run-script
+          mountPath: /free5gc/script/nrf-run.sh
           subPath: nrf-run.sh
-        - name: cp-config
+        - name: config-dir
           mountPath: /free5gc/config
+        - name: common-config
+          mountPath: /tmp/config/free5GC.conf
+          subPath: free5GC.conf
+        - name: nf-config
+          mountPath: /tmp/config/nrfcfg.conf
+          subPath: nrfcfg.conf
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
       {{- end }}
       volumes:
-      - name: cp-script
+      - name: run-script
         configMap:
           name: nrf
           defaultMode: 493
-      - name: cp-config
+      - name: common-config
+        configMap:
+          name: common
+          defaultMode: 493 
+      - name: nf-config
         configMap:
           name: nrf
           defaultMode: 493
+      - name: config-dir
+        emptyDir: {}
     {{- if .Values.config.coreDump.enabled }}
       - name: host-rootfs
         hostPath:
diff --git a/omec/5g-control-plane/templates/statefulset-nssf.yaml b/omec/5g-control-plane/templates/deployment-nssf.yaml
similarity index 71%
rename from omec/5g-control-plane/templates/statefulset-nssf.yaml
rename to omec/5g-control-plane/templates/deployment-nssf.yaml
index 21057f7..f404f1a 100644
--- a/omec/5g-control-plane/templates/statefulset-nssf.yaml
+++ b/omec/5g-control-plane/templates/deployment-nssf.yaml
@@ -8,14 +8,14 @@
 {{ tuple "nssf" . | include "5g-control-plane.service_account" }}
 ---
 apiVersion: apps/v1
-kind: StatefulSet
+kind: Deployment
 metadata:
   name: nssf
   labels:
 {{ tuple "nssf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 spec:
   replicas: 1
-  serviceName: nssf-headless
+  #serviceName: nssf-headless
   selector:
     matchLabels:
 {{ tuple "nssf" . | include "5g-control-plane.metadata_labels" | indent 6 }}
@@ -28,20 +28,16 @@
         {{- toYaml . | nindent 8 }}
     {{- end }}
     spec:
-    {{- if .Values.nodeSelectors.enabled }}
-      nodeSelector:
-        {{ .Values.nodeSelectors.nssf.label }}: {{ .Values.nodeSelectors.nssf.value }}
-    {{- end }}
       serviceAccountName: nssf
-    {{- if .Values.images.credentials }}
+    {{- if hasKey .Values.images "pullSecrets" }}
       imagePullSecrets:
-        - name: {{ .Release.Name }}.registry
+{{ toYaml .Values.images.pullSecrets | indent 8 }}
     {{- end }}
       initContainers:
-      - name: wait-nrf-module
+      - name: wait-nssf-module
         image: {{ .Values.images.tags.init | quote }}
         imagePullPolicy: {{ .Values.images.pullPolicy }}
-        command: ['sh', '-c', 'until nslookup nrf; do echo waiting for nrf; sleep 4; done;']
+        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 }}
@@ -55,7 +51,7 @@
       {{- end }}
         stdin: true
         tty: true
-        command: ["/opt/cp/scripts/nssf-run.sh"]
+        command: ["/free5gc/script/nssf-run.sh"]
         env:
         - name: POD_IP
           valueFrom:
@@ -66,24 +62,36 @@
 {{ toYaml .Values.resources.nssf | indent 10 }}
       {{- end }}
         volumeMounts:
-        - name: cp-script
-          mountPath: /opt/cp/scripts/nssf-run.sh
+        - name: run-script
+          mountPath: /free5gc/script/nssf-run.sh
           subPath: nssf-run.sh
-        - name: cp-config
+        - 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: cp-script
+      - name: run-script
         configMap:
           name: nssf
           defaultMode: 493
-      - name: cp-config
+      - name: common-config
+        configMap:
+          name: common
+          defaultMode: 493 
+      - name: nf-config
         configMap:
           name: nssf
-          defaultMode: 420
+          defaultMode: 493
+      - name: config-dir
+        emptyDir: {}
     {{- if .Values.config.coreDump.enabled }}
       - name: host-rootfs
         hostPath:
diff --git a/omec/5g-control-plane/templates/statefulset-pcf.yaml b/omec/5g-control-plane/templates/deployment-pcf.yaml
similarity index 71%
rename from omec/5g-control-plane/templates/statefulset-pcf.yaml
rename to omec/5g-control-plane/templates/deployment-pcf.yaml
index 1ab5345..65c63a0 100644
--- a/omec/5g-control-plane/templates/statefulset-pcf.yaml
+++ b/omec/5g-control-plane/templates/deployment-pcf.yaml
@@ -8,14 +8,14 @@
 {{ tuple "pcf" . | include "5g-control-plane.service_account" }}
 ---
 apiVersion: apps/v1
-kind: StatefulSet
+kind: Deployment
 metadata:
   name: pcf
   labels:
 {{ tuple "pcf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 spec:
   replicas: 1
-  serviceName: pcf-headless
+  #serviceName: pcf-headless
   selector:
     matchLabels:
 {{ tuple "pcf" . | include "5g-control-plane.metadata_labels" | indent 6 }}
@@ -28,20 +28,16 @@
         {{- toYaml . | nindent 8 }}
     {{- end }}
     spec:
-    {{- if .Values.nodeSelectors.enabled }}
-      nodeSelector:
-        {{ .Values.nodeSelectors.pcf.label }}: {{ .Values.nodeSelectors.pcf.value }}
-    {{- end }}
       serviceAccountName: pcf
-    {{- if .Values.images.credentials }}
+    {{- if hasKey .Values.images "pullSecrets" }}
       imagePullSecrets:
-        - name: {{ .Release.Name }}.registry
+{{ toYaml .Values.images.pullSecrets | indent 8 }}
     {{- end }}
       initContainers:
-      - name: wait-nrf-module
+      - name: wait-pcf-module
         image: {{ .Values.images.tags.init | quote }}
         imagePullPolicy: {{ .Values.images.pullPolicy }}
-        command: ['sh', '-c', 'until nslookup nrf; do echo waiting for nrf; sleep 4; done;']
+        command: ['sh', '-c', 'until nslookup pcf; do echo waiting for pcf; sleep 4; done;']
     {{- if .Values.config.coreDump.enabled }}
 {{ tuple "pcf" . | include "5g-control-plane.coredump_init" | indent 6 }}
     {{- end }}
@@ -55,7 +51,7 @@
       {{- end }}
         stdin: true
         tty: true
-        command: ["/opt/cp/scripts/pcf-run.sh"]
+        command: ["/free5gc/script/pcf-run.sh"]
         env:
         - name: POD_IP
           valueFrom:
@@ -66,24 +62,36 @@
 {{ toYaml .Values.resources.pcf | indent 10 }}
       {{- end }}
         volumeMounts:
-        - name: cp-script
-          mountPath: /opt/cp/scripts/pcf-run.sh
+        - name: run-script
+          mountPath: /free5gc/script/pcf-run.sh
           subPath: pcf-run.sh
-        - name: cp-config
+        - name: config-dir
           mountPath: /free5gc/config
+        - name: common-config
+          mountPath: /tmp/config/free5GC.conf
+          subPath: free5GC.conf
+        - name: nf-config
+          mountPath: /tmp/config/pcfcfg.conf
+          subPath: pcfcfg.conf
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
       {{- end }}
       volumes:
-      - name: cp-script
+      - name: run-script
         configMap:
           name: pcf
           defaultMode: 493
-      - name: cp-config
+      - name: common-config
+        configMap:
+          name: common
+          defaultMode: 493 
+      - name: nf-config
         configMap:
           name: pcf
-          defaultMode: 420
+          defaultMode: 493
+      - name: config-dir
+        emptyDir: {}
     {{- if .Values.config.coreDump.enabled }}
       - name: host-rootfs
         hostPath:
diff --git a/omec/5g-control-plane/templates/statefulset-smf.yaml b/omec/5g-control-plane/templates/deployment-smf.yaml
similarity index 69%
rename from omec/5g-control-plane/templates/statefulset-smf.yaml
rename to omec/5g-control-plane/templates/deployment-smf.yaml
index eee62fa..81b2acf 100644
--- a/omec/5g-control-plane/templates/statefulset-smf.yaml
+++ b/omec/5g-control-plane/templates/deployment-smf.yaml
@@ -8,14 +8,14 @@
 {{ tuple "smf" . | include "5g-control-plane.service_account" }}
 ---
 apiVersion: apps/v1
-kind: StatefulSet
+kind: Deployment
 metadata:
   name: smf
   labels:
 {{ tuple "smf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 spec:
   replicas: 1
-  serviceName: smf-headless
+  #serviceName: smf-headless
   selector:
     matchLabels:
 {{ tuple "smf" . | include "5g-control-plane.metadata_labels" | indent 6 }}
@@ -30,20 +30,16 @@
         {{- toYaml . | nindent 8 }}
     {{- end }}
     spec:
-    {{- if .Values.nodeSelectors.enabled }}
-      nodeSelector:
-        {{ .Values.nodeSelectors.smf.label }}: {{ .Values.nodeSelectors.smf.value }}
-    {{- end }}
       serviceAccountName: smf
-    {{- if .Values.images.credentials }}
+    {{- if hasKey .Values.images "pullSecrets" }}
       imagePullSecrets:
-        - name: {{ .Release.Name }}.registry
+{{ toYaml .Values.images.pullSecrets | indent 8 }}
     {{- end }}
       initContainers:
-      - name: wait-nrf-module
+      - name: wait-smf-module
         image: {{ .Values.images.tags.init | quote }}
         imagePullPolicy: {{ .Values.images.pullPolicy }}
-        command: ['sh', '-c', 'until nslookup nrf; do echo waiting for nrf; sleep 4; done;']
+        command: ['sh', '-c', 'until nslookup smf; do echo waiting for smf; sleep 4; done;']
     {{- if .Values.config.coreDump.enabled }}
 {{ tuple "smf" . | include "5g-control-plane.coredump_init" | indent 6 }}
     {{- end }}
@@ -57,7 +53,7 @@
       {{- end }}
         stdin: true
         tty: true
-        command: ["/opt/cp/scripts/smf-run.sh"]
+        command: ["/free5gc/script/smf-run.sh"]
         env:
         - name: POD_IP
           valueFrom:
@@ -68,24 +64,39 @@
 {{ toYaml .Values.resources.smf | indent 10 }}
       {{- end }}
         volumeMounts:
-        - name: cp-script
-          mountPath: /opt/cp/scripts/smf-run.sh
+        - name: run-script
+          mountPath: /free5gc/script/smf-run.sh
           subPath: smf-run.sh
-        - name: cp-config
+        - name: config-dir
           mountPath: /free5gc/config
+        - name: common-config
+          mountPath: /tmp/config/free5GC.conf
+          subPath: free5GC.conf
+        - name: nf-config
+          mountPath: /tmp/config/uerouting.conf
+          subPath: uerouting.conf
+        - name: nf-config
+          mountPath: /tmp/config/smfcfg.conf
+          subPath: smfcfg.conf
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
       {{- end }}
       volumes:
-      - name: cp-script
+      - name: run-script
         configMap:
           name: smf
           defaultMode: 493
-      - name: cp-config
+      - name: common-config
+        configMap:
+          name: common
+          defaultMode: 493 
+      - name: nf-config
         configMap:
           name: smf
-          defaultMode: 420
+          defaultMode: 493
+      - name: config-dir
+        emptyDir: {}
     {{- if .Values.config.coreDump.enabled }}
       - name: host-rootfs
         hostPath:
diff --git a/omec/5g-control-plane/templates/statefulset-udm.yaml b/omec/5g-control-plane/templates/deployment-udm.yaml
similarity index 73%
rename from omec/5g-control-plane/templates/statefulset-udm.yaml
rename to omec/5g-control-plane/templates/deployment-udm.yaml
index ac3cebc..1107ea1 100644
--- a/omec/5g-control-plane/templates/statefulset-udm.yaml
+++ b/omec/5g-control-plane/templates/deployment-udm.yaml
@@ -8,14 +8,14 @@
 {{ tuple "udm" . | include "5g-control-plane.service_account" }}
 ---
 apiVersion: apps/v1
-kind: StatefulSet
+kind: Deployment
 metadata:
   name: udm
   labels:
 {{ tuple "udm" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 spec:
   replicas: 1
-  serviceName: udm-headless
+  #serviceName: udm-headless
   selector:
     matchLabels:
 {{ tuple "udm" . | include "5g-control-plane.metadata_labels" | indent 6 }}
@@ -28,20 +28,16 @@
         {{- toYaml . | nindent 8 }}
     {{- end }}
     spec:
-    {{- if .Values.nodeSelectors.enabled }}
-      nodeSelector:
-        {{ .Values.nodeSelectors.udm.label }}: {{ .Values.nodeSelectors.udm.value }}
-    {{- end }}
       serviceAccountName: udm
-    {{- if .Values.images.credentials }}
+    {{- if hasKey .Values.images "pullSecrets" }}
       imagePullSecrets:
-        - name: {{ .Release.Name }}.registry
+{{ toYaml .Values.images.pullSecrets | indent 8 }}
     {{- end }}
       initContainers:
-      - name: wait-nrf-module
+      - name: wait-udm-module
         image: {{ .Values.images.tags.init | quote }}
         imagePullPolicy: {{ .Values.images.pullPolicy }}
-        command: ['sh', '-c', 'until nslookup nrf; do echo waiting for nrf; sleep 4; done;']
+        command: ['sh', '-c', 'until nslookup udm; do echo waiting for udm; sleep 4; done;']
       - name: wait-udr-module
         image: {{ .Values.images.tags.init | quote }}
         imagePullPolicy: {{ .Values.images.pullPolicy }}
@@ -59,7 +55,7 @@
       {{- end }}
         stdin: true
         tty: true
-        command: ["/opt/cp/scripts/udm-run.sh"]
+        command: ["/free5gc/script/udm-run.sh"]
         env:
         - name: POD_IP
           valueFrom:
@@ -70,24 +66,36 @@
 {{ toYaml .Values.resources.udm | indent 10 }}
       {{- end }}
         volumeMounts:
-        - name: cp-script
-          mountPath: /opt/cp/scripts/udm-run.sh
+        - name: run-script
+          mountPath: /free5gc/script/udm-run.sh
           subPath: udm-run.sh
-        - name: cp-config
+        - name: config-dir
           mountPath: /free5gc/config
+        - name: common-config
+          mountPath: /tmp/config/free5GC.conf
+          subPath: free5GC.conf
+        - name: nf-config
+          mountPath: /tmp/config/udmcfg.conf
+          subPath: udmcfg.conf
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
       {{- end }}
       volumes:
-      - name: cp-script
+      - name: run-script
         configMap:
           name: udm
           defaultMode: 493
-      - name: cp-config
+      - name: common-config
+        configMap:
+          name: common
+          defaultMode: 493 
+      - name: nf-config
         configMap:
           name: udm
-          defaultMode: 420
+          defaultMode: 493
+      - name: config-dir
+        emptyDir: {}
     {{- if .Values.config.coreDump.enabled }}
       - name: host-rootfs
         hostPath:
diff --git a/omec/5g-control-plane/templates/statefulset-udr.yaml b/omec/5g-control-plane/templates/deployment-udr.yaml
similarity index 71%
rename from omec/5g-control-plane/templates/statefulset-udr.yaml
rename to omec/5g-control-plane/templates/deployment-udr.yaml
index 7fad5f1..0d55e37 100644
--- a/omec/5g-control-plane/templates/statefulset-udr.yaml
+++ b/omec/5g-control-plane/templates/deployment-udr.yaml
@@ -8,14 +8,14 @@
 {{ tuple "udr" . | include "5g-control-plane.service_account" }}
 ---
 apiVersion: apps/v1
-kind: StatefulSet
+kind: Deployment
 metadata:
   name: udr
   labels:
 {{ tuple "udr" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 spec:
   replicas: 1
-  serviceName: udr-headless
+  #serviceName: udr-headless
   selector:
     matchLabels:
 {{ tuple "udr" . | include "5g-control-plane.metadata_labels" | indent 6 }}
@@ -28,20 +28,16 @@
         {{- toYaml . | nindent 8 }}
     {{- end }}
     spec:
-    {{- if .Values.nodeSelectors.enabled }}
-      nodeSelector:
-        {{ .Values.nodeSelectors.udr.label }}: {{ .Values.nodeSelectors.udr.value }}
-    {{- end }}
       serviceAccountName: udr
-    {{- if .Values.images.credentials }}
+    {{- if hasKey .Values.images "pullSecrets" }}
       imagePullSecrets:
-        - name: {{ .Release.Name }}.registry
+{{ toYaml .Values.images.pullSecrets | indent 8 }}
     {{- end }}
       initContainers:
-      - name: wait-nrf-module
+      - name: wait-udr-module
         image: {{ .Values.images.tags.init | quote }}
         imagePullPolicy: {{ .Values.images.pullPolicy }}
-        command: ['sh', '-c', 'until nslookup nrf; do echo waiting for nrf; sleep 4; done;']
+        command: ['sh', '-c', 'until nslookup udr; do echo waiting for udr; sleep 4; done;']
     {{- if .Values.config.coreDump.enabled }}
 {{ tuple "udr" . | include "5g-control-plane.coredump_init" | indent 6 }}
     {{- end }}
@@ -55,7 +51,7 @@
       {{- end }}
         stdin: true
         tty: true
-        command: ["/opt/cp/scripts/udr-run.sh"]
+        command: ["/free5gc/script/udr-run.sh"]
         env:
         - name: POD_IP
           valueFrom:
@@ -66,24 +62,36 @@
 {{ toYaml .Values.resources.udr | indent 10 }}
       {{- end }}
         volumeMounts:
-        - name: cp-script
-          mountPath: /opt/cp/scripts/udr-run.sh
+        - name: run-script
+          mountPath: /free5gc/script/udr-run.sh
           subPath: udr-run.sh
-        - name: cp-config
+        - name: config-dir
           mountPath: /free5gc/config
+        - name: common-config
+          mountPath: /tmp/config/free5GC.conf
+          subPath: free5GC.conf
+        - name: nf-config
+          mountPath: /tmp/config/udrcfg.conf
+          subPath: udrcfg.conf
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
       {{- end }}
       volumes:
-      - name: cp-script
+      - name: run-script
         configMap:
           name: udr
           defaultMode: 493
-      - name: cp-config
+      - name: common-config
+        configMap:
+          name: common
+          defaultMode: 493 
+      - name: nf-config
         configMap:
           name: udr
-          defaultMode: 420
+          defaultMode: 493
+      - name: config-dir
+        emptyDir: {}
     {{- if .Values.config.coreDump.enabled }}
       - name: host-rootfs
         hostPath:
diff --git a/omec/5g-control-plane/templates/deployment-webui.yaml b/omec/5g-control-plane/templates/deployment-webui.yaml
index a01138e..6c554ec 100644
--- a/omec/5g-control-plane/templates/deployment-webui.yaml
+++ b/omec/5g-control-plane/templates/deployment-webui.yaml
@@ -27,20 +27,16 @@
         {{- toYaml . | nindent 8 }}
     {{- end }}
     spec:
-    {{- if .Values.nodeSelectors.enabled }}
-      nodeSelector:
-        {{ .Values.nodeSelectors.webui.label }}: {{ .Values.nodeSelectors.webui.value }}
-    {{- end }}
       serviceAccountName: webui
-    {{- if .Values.images.credentials }}
+    {{- if hasKey .Values.images "pullSecrets" }}
       imagePullSecrets:
-        - name: {{ .Release.Name }}.registry
+{{ toYaml .Values.images.pullSecrets | indent 8 }}
     {{- end }}
       initContainers:
-      - name: wait-nrf-module
+      - name: wait-webui-module
         image: {{ .Values.images.tags.init | quote }}
         imagePullPolicy: {{ .Values.images.pullPolicy }}
-        command: ['sh', '-c', 'until nslookup nrf; do echo waiting for nrf; sleep 4; done;']
+        command: ['sh', '-c', 'until nslookup webui; do echo waiting for webui; sleep 4; done;']
     {{- if .Values.config.coreDump.enabled }}
 {{ tuple "webui" . | include "5g-control-plane.coredump_init" | indent 6 }}
     {{- end }}
@@ -54,30 +50,42 @@
       {{- end }}
         stdin: true
         tty: true
-        command: ["/opt/cp/scripts/webui-run.sh"]
+        command: ["/free5gc/script/webui-run.sh"]
       {{- if .Values.resources.enabled }}
         resources:
 {{ toYaml .Values.resources.webui | indent 10 }}
       {{- end }}
         volumeMounts:
-        - name: cp-script
-          mountPath: /opt/cp/scripts/webui-run.sh
+        - name: run-script
+          mountPath: /free5gc/script/webui-run.sh
           subPath: webui-run.sh
-        - name: cp-config
+        - name: config-dir
           mountPath: /free5gc/config
+        - name: common-config
+          mountPath: /tmp/config/free5GC.conf
+          subPath: free5GC.conf
+        - name: nf-config
+          mountPath: /tmp/config/webuicfg.conf
+          subPath: webuicfg.conf
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
       {{- end }}
       volumes:
-      - name: cp-script
+      - name: run-script
         configMap:
           name: webui
           defaultMode: 493
-      - name: cp-config
+      - name: common-config
+        configMap:
+          name: common
+          defaultMode: 493 
+      - name: nf-config
         configMap:
           name: webui
-          defaultMode: 420
+          defaultMode: 493
+      - name: config-dir
+        emptyDir: {}
     {{- if .Values.config.coreDump.enabled }}
       - name: host-rootfs
         hostPath:
diff --git a/omec/5g-control-plane/templates/ingress-webui.yaml b/omec/5g-control-plane/templates/ingress-webui.yaml
new file mode 100644
index 0000000..b41c736
--- /dev/null
+++ b/omec/5g-control-plane/templates/ingress-webui.yaml
@@ -0,0 +1,26 @@
+{{/*
+# Copyright 2020-present Open Networking Foundation
+
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+{{- if .Values.config.webui.ingress.enabled }}
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: webui
+  labels:
+{{ tuple "webui" . | include "5g-control-plane.metadata_labels" | indent 4 }}
+spec:
+  rules:
+    - host: {{ .Values.config.webui.ingress.hostname }}
+      http:
+        paths:
+          - path: {{ .Values.config.webui.ingress.path }}
+            pathType: {{ .Values.config.webui.ingress.pathType }}
+            backend:
+              service:
+                name: webui
+                port:
+                  number: {{ .Values.config.webui.urlport.port }}
+{{- end }}
\ No newline at end of file
diff --git a/omec/5g-control-plane/templates/service-amf.yaml b/omec/5g-control-plane/templates/service-amf.yaml
index 2330411..5e37bdf 100644
--- a/omec/5g-control-plane/templates/service-amf.yaml
+++ b/omec/5g-control-plane/templates/service-amf.yaml
@@ -26,17 +26,6 @@
   - name: ngapp
     port: {{ .Values.config.amf.ngapp.port }}
     protocol: SCTP
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: amf-headless
-  labels:
-{{ tuple "amf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
-spec:
-  clusterIP: None
-  selector:
-{{ tuple "amf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 {{- if or .Values.config.amf.prometheus.nodePort.enabled .Values.config.amf.sbi.nodePort.enabled .Values.config.amf.ngapp.nodePort.enabled }}
 ---
 apiVersion: v1
diff --git a/omec/5g-control-plane/templates/service-ausf.yaml b/omec/5g-control-plane/templates/service-ausf.yaml
index c06af07..defa18f 100644
--- a/omec/5g-control-plane/templates/service-ausf.yaml
+++ b/omec/5g-control-plane/templates/service-ausf.yaml
@@ -23,17 +23,6 @@
   - name: sbi
     port: {{ .Values.config.ausf.sbi.port }}
     protocol: TCP
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: ausf-headless
-  labels:
-{{ tuple "ausf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
-spec:
-  clusterIP: None
-  selector:
-{{ tuple "ausf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 {{- if or .Values.config.ausf.prometheus.nodePort.enabled .Values.config.ausf.sbi.nodePort.enabled }}
 ---
 apiVersion: v1
diff --git a/omec/5g-control-plane/templates/service-nrf.yaml b/omec/5g-control-plane/templates/service-nrf.yaml
index efee971..cbe45d1 100644
--- a/omec/5g-control-plane/templates/service-nrf.yaml
+++ b/omec/5g-control-plane/templates/service-nrf.yaml
@@ -20,17 +20,6 @@
   - name: sbi
     port: {{ .Values.config.nrf.sbi.port }}
     protocol: TCP
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: nrf-headless
-  labels:
-{{ tuple "nrf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
-spec:
-  clusterIP: None
-  selector:
-{{ tuple "nrf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 {{- if or .Values.config.nrf.sbi.nodePort.enabled }}
 ---
 apiVersion: v1
diff --git a/omec/5g-control-plane/templates/service-nssf.yaml b/omec/5g-control-plane/templates/service-nssf.yaml
index a709cc2..d92d524 100644
--- a/omec/5g-control-plane/templates/service-nssf.yaml
+++ b/omec/5g-control-plane/templates/service-nssf.yaml
@@ -23,17 +23,6 @@
   - name: sbi
     port: {{ .Values.config.nssf.sbi.port }}
     protocol: TCP
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: nssf-headless
-  labels:
-{{ tuple "nssf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
-spec:
-  clusterIP: None
-  selector:
-{{ tuple "nssf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 {{- if or .Values.config.nssf.prometheus.nodePort.enabled .Values.config.nssf.sbi.nodePort.enabled }}
 ---
 apiVersion: v1
diff --git a/omec/5g-control-plane/templates/service-pcf.yaml b/omec/5g-control-plane/templates/service-pcf.yaml
index bfb0e05..69724df 100644
--- a/omec/5g-control-plane/templates/service-pcf.yaml
+++ b/omec/5g-control-plane/templates/service-pcf.yaml
@@ -23,17 +23,6 @@
   - name: sbi
     port: {{ .Values.config.pcf.sbi.port }}
     protocol: TCP
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: pcf-headless
-  labels:
-{{ tuple "pcf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
-spec:
-  clusterIP: None
-  selector:
-{{ tuple "pcf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 {{- if or .Values.config.pcf.prometheus.nodePort.enabled .Values.config.pcf.sbi.nodePort.enabled }}
 ---
 apiVersion: v1
diff --git a/omec/5g-control-plane/templates/service-smf.yaml b/omec/5g-control-plane/templates/service-smf.yaml
index 467c2ea..8e9d50d 100644
--- a/omec/5g-control-plane/templates/service-smf.yaml
+++ b/omec/5g-control-plane/templates/service-smf.yaml
@@ -26,17 +26,6 @@
   - name: sbi
     port: {{ .Values.config.smf.sbi.port }}
     protocol: TCP
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: smf-headless
-  labels:
-{{ tuple "smf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
-spec:
-  clusterIP: None
-  selector:
-{{ tuple "smf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 {{- if or .Values.config.smf.n4.nodePort.enabled .Values.config.smf.prometheus.nodePort.enabled .Values.config.smf.sbi.nodePort.enabled }}
 ---
 apiVersion: v1
diff --git a/omec/5g-control-plane/templates/service-udm.yaml b/omec/5g-control-plane/templates/service-udm.yaml
index d3c47d0..c2269b7 100644
--- a/omec/5g-control-plane/templates/service-udm.yaml
+++ b/omec/5g-control-plane/templates/service-udm.yaml
@@ -23,17 +23,6 @@
   - name: sbi
     port: {{ .Values.config.udm.sbi.port }}
     protocol: TCP
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: udm-headless
-  labels:
-{{ tuple "udm" . | include "5g-control-plane.metadata_labels" | indent 4 }}
-spec:
-  clusterIP: None
-  selector:
-{{ tuple "udm" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 {{- if or .Values.config.udm.prometheus.nodePort.enabled .Values.config.udm.sbi.nodePort.enabled }}
 ---
 apiVersion: v1
diff --git a/omec/5g-control-plane/templates/service-udr.yaml b/omec/5g-control-plane/templates/service-udr.yaml
index 0dc4720..44e0c82 100644
--- a/omec/5g-control-plane/templates/service-udr.yaml
+++ b/omec/5g-control-plane/templates/service-udr.yaml
@@ -23,17 +23,6 @@
   - name: sbi
     port: {{ .Values.config.udr.sbi.port }}
     protocol: TCP
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: udr-headless
-  labels:
-{{ tuple "udr" . | include "5g-control-plane.metadata_labels" | indent 4 }}
-spec:
-  clusterIP: None
-  selector:
-{{ tuple "udr" . | include "5g-control-plane.metadata_labels" | indent 4 }}
 {{- if or .Values.config.udr.prometheus.nodePort.enabled .Values.config.udr.sbi.nodePort.enabled }}
 ---
 apiVersion: v1
diff --git a/omec/5g-control-plane/templates/service-webui.yaml b/omec/5g-control-plane/templates/service-webui.yaml
index 72457ba..76a3273 100644
--- a/omec/5g-control-plane/templates/service-webui.yaml
+++ b/omec/5g-control-plane/templates/service-webui.yaml
@@ -20,19 +20,10 @@
   - name: prometheus-exporter
     port: {{ .Values.config.webui.prometheus.port }}
     protocol: TCP
-
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: webui-headless
-  labels:
-{{ tuple "webui" . | include "5g-control-plane.metadata_labels" | indent 4 }}
-spec:
-  clusterIP: None
-  selector:
-{{ tuple "webui" . | include "5g-control-plane.metadata_labels" | indent 4 }}
-{{- if or .Values.config.webui.prometheus.nodePort.enabled }}
+  - name: urlport-http
+    port: {{ .Values.config.webui.urlport.port }}
+    protocol: TCP
+{{- if or .Values.config.webui.urlport.nodePort.enabled .Values.config.webui.prometheus.nodePort.enabled }}
 ---
 apiVersion: v1
 kind: Service