Configuration for connection peer in values.yaml

Change-Id: Ib291c01d98e072817e67d458b439cbbe7330ffd8
diff --git a/mcord/mcord-control-plane/templates/cassandra.yaml b/mcord/mcord-control-plane/templates/cassandra.yaml
index d20ed06..1344bce 100644
--- a/mcord/mcord-control-plane/templates/cassandra.yaml
+++ b/mcord/mcord-control-plane/templates/cassandra.yaml
@@ -59,7 +59,7 @@
           - name: HEAP_NEWSIZE
             value: 100M
           - name: CASSANDRA_SEEDS
-            value: "cassandra-0.cassandra.{{ .Release.Name }}.svc.cluster.local"
+            value: "{{ .Values.hssdb_hostname }}-0"
           - name: CASSANDRA_CLUSTER_NAME
             value: "HSS Cluster"
           - name: CASSANDRA_RPC_ADDRESS
diff --git a/mcord/mcord-control-plane/templates/cm.yaml b/mcord/mcord-control-plane/templates/cm.yaml
index da5f864..8d01742 100644
--- a/mcord/mcord-control-plane/templates/cm.yaml
+++ b/mcord/mcord-control-plane/templates/cm.yaml
@@ -132,8 +132,8 @@
     APP_ARGS="${S1U} ${SGI} ${WORKERS} ${MISC} ${SPGW_CFG}"
   interface.cfg: |
     [0]
-    dp_comm_ip = {{ .Values.dataplane_hostname }}
-    dp_comm_port = {{ .Values.dataplane_port }}
+    dp_comm_ip = {{ .Values.spgwu_hostname }}
+    dp_comm_port = {{ .Values.spgwu_port }}
     cp_comm_ip = 127.0.0.1
     cp_comm_port = 21
   meter_profile.cfg: |
diff --git a/mcord/mcord-control-plane/templates/cp.yaml b/mcord/mcord-control-plane/templates/cp.yaml
index ad417d8..ceae015 100644
--- a/mcord/mcord-control-plane/templates/cp.yaml
+++ b/mcord/mcord-control-plane/templates/cp.yaml
@@ -63,12 +63,15 @@
         image: {{ .Values.ngic_cp.images.cp }}
         imagePullPolicy: IfNotPresent
         stdin: true
-        command: [ "bash",  "-cx", ". /opt/ngic/config/cp_config.cfg; sleep 20; ./ngic_controlplane  $EAL_ARGS -- $APP_ARGS"]
-        #command: ["sleep", "3600"]
+        command: [ "bash",  "-xc"]
+        args:
+        - . /opt/ngic/config/cp_config.cfg;
+        - sleep 20;
+        - ./ngic_controlplane $EAL_ARGS -- $APP_ARGS;
         tty: true
         env:
         - name: MME_S11_IP
-          value: mme
+          value: {{ .Values.mme_hostname }}
         #- name: SGW_S1U_IP  # for now,this will be in our own pod
         #  value: "5.5.5.5"
         - name: APN
diff --git a/mcord/mcord-control-plane/templates/hss.yaml b/mcord/mcord-control-plane/templates/hss.yaml
index 6c7c9e4..89c7167 100644
--- a/mcord/mcord-control-plane/templates/hss.yaml
+++ b/mcord/mcord-control-plane/templates/hss.yaml
@@ -48,25 +48,28 @@
       initContainers:
       - name: init-db
         image: {{ .Values.hss.images.init }}
-        command: [ "bash", "-xc"]
+        command: ["bash", "-xc"]
         args:
-        - until nslookup cassandra; do echo waiting for cassandra; sleep 2; done;
-          sleep 5;
-          cqlsh --file /scripts/oai_db.cql cassandra;
-          /scripts/data_provisioning_users.sh 302720100000421 1122334456 apn1 6226194254742F2D67145153602F7C8D 1 cassandra mme mme;
-          cqlsh -e "use vhss; update users_imsi set opc='D6CAF10C337FD65AC31A18EBACBF5BF9' where imsi='302720100000421';" cassandra;
-          cqlsh -e "select imsi,key,opc,sqn from vhss.users_imsi;" cassandra;
-          /scripts/data_provisioning_mme.sh 1 19136246000 mme mme 1 cassandra;
-          /scripts/data_provisioning_mme.sh 1 19136246000 smsrouter.test3gpp.net test3gpp.net 0  cassandra;
+        - until nslookup {{ .Values.hssdb_hostname }}; do echo waiting for cassandra; sleep 2; done;
+        - sleep 5;
+        - cqlsh --file /scripts/oai_db.cql cassandra;
+        - /scripts/data_provisioning_users.sh 302720100000421 1122334456 apn1 6226194254742F2D67145153602F7C8D 1 cassandra {{ .Values.mme_hostname }} {{ .Values.mme_hostname }};
+        - cqlsh -e "use vhss; update users_imsi set opc='D6CAF10C337FD65AC31A18EBACBF5BF9' where imsi='302720100000421';" cassandra;
+        - cqlsh -e "select imsi,key,opc,sqn from vhss.users_imsi;" cassandra;
+        - /scripts/data_provisioning_mme.sh 1 19136246000 {{ .Values.mme_hostname }} {{ .Values.mme_hostname }} 1 cassandra;
+        - /scripts/data_provisioning_mme.sh 1 19136246000 smsrouter.test3gpp.net test3gpp.net 0  cassandra;
       containers:
       - name: hss
         image: {{ .Values.hss.images.hss }}
         imagePullPolicy: Always
+        command: ["bash", "-xc"]
+        args:
+        - sleep 3600;
         env:
           - name: CASSANDRA_ADDR
             value: cassandra
           - name: MME_ADDR
-            value: mme
+            value: {{ .Values.mme_hostname }}
         #command: [ "sleep", "3600"]
         resources:
           limits:
diff --git a/mcord/mcord-control-plane/templates/mme.yaml b/mcord/mcord-control-plane/templates/mme.yaml
index 2f2ebd4..d0e1ff5 100644
--- a/mcord/mcord-control-plane/templates/mme.yaml
+++ b/mcord/mcord-control-plane/templates/mme.yaml
@@ -61,16 +61,15 @@
             add:
               - NET_ADMIN
         args:
+        - until nslookup {{ .Values.hss_hostname }}; do echo waiting for hss; sleep 2; done;
         - iptables -A OUTPUT -p sctp --sport {{ .Values.mme.ports.s1ap }} --chunk-types any ABORT -j DROP;
-          until nslookup hss;
-          do echo waiting for hss; sleep 2; done;
       containers:
       - name: mme
         image: {{ .Values.mme.images.mme }}
         imagePullPolicy: Always
         env:
           - name: SGW_S11_IP
-            value: ngic-cp
+            value: {{ .Values.spgwc_hostname }}
           - name: MME_ETH0_IP
             valueFrom:
               fieldRef:
@@ -80,11 +79,11 @@
           - name: ENB_S1AP_PORT
             value: "{{ .Values.mme.ports.s1ap }}"   #ng4t uses 32767
           - name: CONNECT_PEER
-            value: hss
+            value: {{ .Values.hss_hostname }}
           - name: VAR_HSS_REALM
-            value: hss
+            value: {{ .Values.hss_hostname }}
           - name: HSS_S6A_IP
-            value: hss
+            value: {{ .Values.hss_hostname }}
           - name: HSS_PORT
             value: "{{ .Values.mme.ports.s6a }}"
         stdin: true
diff --git a/mcord/mcord-control-plane/values.yaml b/mcord/mcord-control-plane/values.yaml
index 3e45d29..7bb905d 100644
--- a/mcord/mcord-control-plane/values.yaml
+++ b/mcord/mcord-control-plane/values.yaml
@@ -17,8 +17,12 @@
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
 
-dataplane_hostname: "ngic-dp"
-dataplane_port: 20
+hssdb_hostname: "cassandra"
+hss_hostname: "hss"
+mme_hostname: "mme"
+spgwc_hostname: "ngic-cp"
+spgwu_hostname: "ngic-dp"
+spgwu_port: 20
 
 hss:
   # TODO: init UE's IMEI to DB?
diff --git a/mcord/mcord-data-plane/templates/dp.yaml b/mcord/mcord-data-plane/templates/dp.yaml
index a55bb52..3564458 100644
--- a/mcord/mcord-data-plane/templates/dp.yaml
+++ b/mcord/mcord-data-plane/templates/dp.yaml
@@ -77,8 +77,11 @@
               containerName: ngic
               resource: limits.memory
               divisor: 1Mi
-        command: [ "bash",  "-cx", "ifconfig -a; . /opt/ngic/config/dp_config.cfg ; ./ngic_dataplane  $EAL_ARGS -- $APP_ARGS"]
-        #command: ["sleep", "3600"]
+        command: [ "bash",  "-xc"]
+        args:
+        - ifconfig -a; ifconfig lo down;
+        - . /opt/ngic/config/dp_config.cfg;
+        - ./ngic_dataplane $EAL_ARGS -- $APP_ARGS
         volumeMounts:
         - name: config-volume
           mountPath: /opt/ngic/config