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