Dynamic Config Helm Changes

This reverts commit 64f3435aa9d2e0a720e2f366a2db9eed5d74b118.

Reason for revert: revert for review

Change-Id: Iecd863deba01cdd9f433945e69e31e94f717f4eb
diff --git a/omec/5g-control-plane/Chart.yaml b/omec/5g-control-plane/Chart.yaml
index 75bc18a..a239ac1 100644
--- a/omec/5g-control-plane/Chart.yaml
+++ b/omec/5g-control-plane/Chart.yaml
@@ -8,7 +8,7 @@
 name: 5g-control-plane
 icon: https://guide.opencord.org/logos/cord.svg
 
-version: 0.2.10
+version: 0.2.11
 
 dependencies:
   - name: mongodb
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 e0340be..6431556 100644
--- a/omec/5g-control-plane/templates/bin/_amf-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_amf-run.sh.tpl
@@ -10,6 +10,7 @@
 cp /free5gc/amf/amf /tmp/coredump/
 {{- end }}
 
-cat /free5gc/config/amfcfg.conf
+cd /free5gc
+cat config/amfcfg.conf
 
-/free5gc/amf/amf -amfcfg /free5gc/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 52a47d8..ed35bf5 100644
--- a/omec/5g-control-plane/templates/bin/_ausf-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_ausf-run.sh.tpl
@@ -11,8 +11,6 @@
 {{- end }}
 
 cd /free5gc
-cp /tmp/config/* config/
-
 cat config/ausfcfg.conf
 
 ./ausf/ausf -ausfcfg config/ausfcfg.conf
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 fcce2ac..342f1fc 100644
--- a/omec/5g-control-plane/templates/bin/_nrf-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_nrf-run.sh.tpl
@@ -11,8 +11,6 @@
 {{- end }}
 
 cd /free5gc
-cp /tmp/config/* config/
-sed -i "s/POD_IP/${POD_IP}/g" config/nrfcfg.conf
 
 cat 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 1a7b680..d170e4d 100644
--- a/omec/5g-control-plane/templates/bin/_nssf-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_nssf-run.sh.tpl
@@ -11,7 +11,6 @@
 {{- end }}
 
 cd /free5gc
-cp /tmp/config/* config/
 
 cat 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 63deb77..bdcf857 100644
--- a/omec/5g-control-plane/templates/bin/_pcf-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_pcf-run.sh.tpl
@@ -11,7 +11,6 @@
 {{- end }}
 
 cd /free5gc
-cp /tmp/config/* config/
 
 cat 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 bdad8fb..3e59803 100644
--- a/omec/5g-control-plane/templates/bin/_smf-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_smf-run.sh.tpl
@@ -11,10 +11,8 @@
 {{- end }}
 
 cd /free5gc
-cp /tmp/config/* config/
-sed -i "s/POD_IP/${POD_IP}/g" config/smfcfg.conf
 
 cat config/smfcfg.conf
-cat config/uerouting.conf
+cat uerouting/uerouting.conf
 
-./smf/smf -smfcfg config/smfcfg.conf -uerouting config/uerouting.conf
+./smf/smf -smfcfg config/smfcfg.conf -uerouting uerouting/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 3d26271..36d1d65 100644
--- a/omec/5g-control-plane/templates/bin/_udm-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_udm-run.sh.tpl
@@ -11,7 +11,6 @@
 {{- end }}
 
 cd /free5gc
-cp /tmp/config/* config/
 
 cat 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 c9a66b4..da52959 100644
--- a/omec/5g-control-plane/templates/bin/_udr-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_udr-run.sh.tpl
@@ -11,7 +11,6 @@
 {{- end }}
 
 cd /free5gc
-cp /tmp/config/* config/
 
 cat 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 4704133..bcca02b 100644
--- a/omec/5g-control-plane/templates/bin/_webui-run.sh.tpl
+++ b/omec/5g-control-plane/templates/bin/_webui-run.sh.tpl
@@ -11,7 +11,6 @@
 {{- end }}
 
 cd /free5gc
-cp /tmp/config/* config/
 
 cat config/webuicfg.conf
 
diff --git a/omec/5g-control-plane/templates/configmap-nrf.yaml b/omec/5g-control-plane/templates/configmap-nrf.yaml
index d93d739..ccb236b 100644
--- a/omec/5g-control-plane/templates/configmap-nrf.yaml
+++ b/omec/5g-control-plane/templates/configmap-nrf.yaml
@@ -19,10 +19,6 @@
 {{- $_ := .Values.config.mongodb.url | set $config "MongoDBUrl" -}}
 {{- end }}
 
-{{- if not (hasKey $config "DefaultServiceIP") -}}
-{{- $_ := "POD_IP" | set $config "DefaultServiceIP" -}}
-{{- end }}
-
 {{- if not (hasKey $nrfcfg "logger") -}}
 {{- $_ := .Values.config.logger | set $nrfcfg "logger" -}}
 {{- end }}
diff --git a/omec/5g-control-plane/templates/configmap-smf.yaml b/omec/5g-control-plane/templates/configmap-smf.yaml
index 502fa06..429499c 100644
--- a/omec/5g-control-plane/templates/configmap-smf.yaml
+++ b/omec/5g-control-plane/templates/configmap-smf.yaml
@@ -10,9 +10,6 @@
 {{- $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 $smfcfg "logger") -}}
 {{- $_ := .Values.config.logger | set $smfcfg "logger" -}}
 {{- end }}
diff --git a/omec/5g-control-plane/templates/deployment-ausf.yaml b/omec/5g-control-plane/templates/deployment-ausf.yaml
index efd957e..c73f40d 100644
--- a/omec/5g-control-plane/templates/deployment-ausf.yaml
+++ b/omec/5g-control-plane/templates/deployment-ausf.yaml
@@ -67,11 +67,8 @@
         - name: run-script
           mountPath: /free5gc/script/ausf-run.sh
           subPath: ausf-run.sh
-        - name: config-dir
-          mountPath: /free5gc/config
         - name: nf-config
-          mountPath: /tmp/config/ausfcfg.conf
-          subPath: ausfcfg.conf
+          mountPath: /free5gc/config
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
@@ -85,8 +82,6 @@
         configMap:
           name: ausf
           defaultMode: 493
-      - name: config-dir
-        emptyDir: {}
     {{- if .Values.config.coreDump.enabled }}
       - name: host-rootfs
         hostPath:
diff --git a/omec/5g-control-plane/templates/deployment-nrf.yaml b/omec/5g-control-plane/templates/deployment-nrf.yaml
index 3c14d58..af22da2 100644
--- a/omec/5g-control-plane/templates/deployment-nrf.yaml
+++ b/omec/5g-control-plane/templates/deployment-nrf.yaml
@@ -63,11 +63,8 @@
         - name: run-script
           mountPath: /free5gc/script/nrf-run.sh
           subPath: nrf-run.sh
-        - name: config-dir
-          mountPath: /free5gc/config
         - name: nf-config
-          mountPath: /tmp/config/nrfcfg.conf
-          subPath: nrfcfg.conf
+          mountPath: /free5gc/config
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
@@ -81,8 +78,6 @@
         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/deployment-nssf.yaml b/omec/5g-control-plane/templates/deployment-nssf.yaml
index 19a9cbb..5ec2509 100644
--- a/omec/5g-control-plane/templates/deployment-nssf.yaml
+++ b/omec/5g-control-plane/templates/deployment-nssf.yaml
@@ -65,11 +65,8 @@
         - name: run-script
           mountPath: /free5gc/script/nssf-run.sh
           subPath: nssf-run.sh
-        - name: config-dir
-          mountPath: /free5gc/config
         - name: nf-config
-          mountPath: /tmp/config/nssfcfg.conf
-          subPath: nssfcfg.conf
+          mountPath: /free5gc/config
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
@@ -83,8 +80,6 @@
         configMap:
           name: nssf
           defaultMode: 493
-      - name: config-dir
-        emptyDir: {}
     {{- if .Values.config.coreDump.enabled }}
       - name: host-rootfs
         hostPath:
diff --git a/omec/5g-control-plane/templates/deployment-pcf.yaml b/omec/5g-control-plane/templates/deployment-pcf.yaml
index 92d6fce..1a2e470 100644
--- a/omec/5g-control-plane/templates/deployment-pcf.yaml
+++ b/omec/5g-control-plane/templates/deployment-pcf.yaml
@@ -65,11 +65,8 @@
         - name: run-script
           mountPath: /free5gc/script/pcf-run.sh
           subPath: pcf-run.sh
-        - name: config-dir
-          mountPath: /free5gc/config
         - name: nf-config
-          mountPath: /tmp/config/pcfcfg.conf
-          subPath: pcfcfg.conf
+          mountPath: /free5gc/config
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
@@ -83,8 +80,6 @@
         configMap:
           name: pcf
           defaultMode: 493
-      - name: config-dir
-        emptyDir: {}
     {{- if .Values.config.coreDump.enabled }}
       - name: host-rootfs
         hostPath:
diff --git a/omec/5g-control-plane/templates/deployment-smf.yaml b/omec/5g-control-plane/templates/deployment-smf.yaml
index 030d1f2..0ee4676 100644
--- a/omec/5g-control-plane/templates/deployment-smf.yaml
+++ b/omec/5g-control-plane/templates/deployment-smf.yaml
@@ -67,14 +67,10 @@
         - name: run-script
           mountPath: /free5gc/script/smf-run.sh
           subPath: smf-run.sh
-        - name: config-dir
+        - name: nf-config
+          mountPath: /free5gc/uerouting
+        - name: nf-config
           mountPath: /free5gc/config
-        - 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
@@ -88,8 +84,6 @@
         configMap:
           name: smf
           defaultMode: 493
-      - name: config-dir
-        emptyDir: {}
     {{- if .Values.config.coreDump.enabled }}
       - name: host-rootfs
         hostPath:
diff --git a/omec/5g-control-plane/templates/deployment-udm.yaml b/omec/5g-control-plane/templates/deployment-udm.yaml
index a762125..e0adc86 100644
--- a/omec/5g-control-plane/templates/deployment-udm.yaml
+++ b/omec/5g-control-plane/templates/deployment-udm.yaml
@@ -69,11 +69,8 @@
         - name: run-script
           mountPath: /free5gc/script/udm-run.sh
           subPath: udm-run.sh
-        - name: config-dir
-          mountPath: /free5gc/config
         - name: nf-config
-          mountPath: /tmp/config/udmcfg.conf
-          subPath: udmcfg.conf
+          mountPath: /free5gc/config
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
diff --git a/omec/5g-control-plane/templates/deployment-udr.yaml b/omec/5g-control-plane/templates/deployment-udr.yaml
index 2cdde55..b6b877a 100644
--- a/omec/5g-control-plane/templates/deployment-udr.yaml
+++ b/omec/5g-control-plane/templates/deployment-udr.yaml
@@ -65,11 +65,8 @@
         - name: run-script
           mountPath: /free5gc/script/udr-run.sh
           subPath: udr-run.sh
-        - name: config-dir
-          mountPath: /free5gc/config
         - name: nf-config
-          mountPath: /tmp/config/udrcfg.conf
-          subPath: udrcfg.conf
+          mountPath: /free5gc/config
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
@@ -83,8 +80,6 @@
         configMap:
           name: udr
           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 508838e..78713a8 100644
--- a/omec/5g-control-plane/templates/deployment-webui.yaml
+++ b/omec/5g-control-plane/templates/deployment-webui.yaml
@@ -59,11 +59,8 @@
         - name: run-script
           mountPath: /free5gc/script/webui-run.sh
           subPath: webui-run.sh
-        - name: config-dir
-          mountPath: /free5gc/config
         - name: nf-config
-          mountPath: /tmp/config/webuicfg.conf
-          subPath: webuicfg.conf
+          mountPath: /free5gc/config
       {{- if .Values.config.coreDump.enabled }}
         - name: coredump
           mountPath: /tmp/coredump
@@ -77,8 +74,6 @@
         configMap:
           name: webui
           defaultMode: 493
-      - name: config-dir
-        emptyDir: {}
     {{- if .Values.config.coreDump.enabled }}
       - name: host-rootfs
         hostPath:
diff --git a/omec/5g-control-plane/values.yaml b/omec/5g-control-plane/values.yaml
index e5e44b3..3d30416 100644
--- a/omec/5g-control-plane/values.yaml
+++ b/omec/5g-control-plane/values.yaml
@@ -302,6 +302,9 @@
           version: 1.0.0
           description: PCF initial local configuration
         configuration:
+          mongodb:       # the mongodb connected by this PCF
+            name: free5gc                  # name of the mongodb
+            url: mongodb://mongodb-arbiter-headless:27017 # a valid URL of the mongodb
           pcfName: PCF
           nrfUri: http://nrf:29510
           sbi:
@@ -526,6 +529,8 @@
           version: 1.0.0
           description: SMF initial local configuration
         configuration:
+          pfcp:
+             addr: "0.0.0.0"
           smfName: SMF
           nrfUri: http://nrf:29510
           sbi: