Change CDN to assign static IP for S1U interface

Change-Id: I1493cdd7c89a0bc86a47f631e91ad79863fb2a11
diff --git a/cdn-services/cdn-local/Chart.yaml b/cdn-services/cdn-local/Chart.yaml
index 614bb98..7ed8d61 100644
--- a/cdn-services/cdn-local/Chart.yaml
+++ b/cdn-services/cdn-local/Chart.yaml
@@ -17,4 +17,4 @@
 appVersion: "1.0"
 description: A Helm chart for M-CORD CDN Services in Local Edge
 name: cdn-local
-version: 0.0.4
+version: 0.0.5
diff --git a/cdn-services/cdn-local/templates/cm.yaml b/cdn-services/cdn-local/templates/cm.yaml
index d6d7849..49b5f95 100644
--- a/cdn-services/cdn-local/templates/cm.yaml
+++ b/cdn-services/cdn-local/templates/cm.yaml
@@ -21,9 +21,9 @@
 data:
   nginx_rtmp_config.sh: |+
     #!/bin/bash
-    ip route add {{ .Values.ue_ip_subnet1 }} via {{ .Values.spgwu_sgiip }} dev sgi-net;
-    ip route add {{ .Values.ue_ip_subnet2 }} via {{ .Values.spgwu_sgiip }} dev sgi-net;
-    ip link set sgi-net mtu 1200;
+    ip route add {{ .Values.ue_ip_subnet1 }} via {{ .Values.spgwu_sgiip }} dev sgi-net-nd;
+    ip route add {{ .Values.ue_ip_subnet2 }} via {{ .Values.spgwu_sgiip }} dev sgi-net-nd;
+    ip link set sgi-net-nd mtu 1200;
     cp /conf/nginx.conf  /etc/nginx/
     nginx -g "daemon off;"
 ---
diff --git a/cdn-services/cdn-local/templates/networks.yaml b/cdn-services/cdn-local/templates/networks.yaml
index ec2707f..3af289c 100644
--- a/cdn-services/cdn-local/templates/networks.yaml
+++ b/cdn-services/cdn-local/templates/networks.yaml
@@ -14,29 +14,19 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{- range .Values.network.networks }}
 ---
 apiVersion: "k8s.cni.cncf.io/v1"
 kind: NetworkAttachmentDefinition
 metadata:
-  name: {{ .name }}
-{{- if $.Values.network.sriov.enabled }}
+  name: sgi-net-nd
+{{- if .Values.networks.sriov.enabled }}
   annotations:
     k8s.v1.cni.cncf.io/resourceName: intel.com/sriov_netdevice
 {{- end }}
 spec:
   config: '{
-    "type": {{ .type | quote }},
+    "type": {{ .Values.networks.sgi_net_nd.type | quote }},
     "ipam": {
-        "type": {{ .ipam | quote }},
-    {{- if eq .ipam "host-local" }}
-        "subnet": {{ .subnet | quote }},
-        "gateway": {{ .gateway | quote }}
-    {{- else if eq .ipam "centralip" }}
-        "ipType": "cluster",
-        "network": {{ .subnet | quote }},
-        "etcdURL": {{ $.Values.etcdurl | quote }}
-    {{- end }}
+        "type": {{ .Values.networks.sgi_net_nd.ipam | quote }}
     }
   }'
-{{- end }}
diff --git a/cdn-services/cdn-local/templates/nginx.yaml b/cdn-services/cdn-local/templates/nginx.yaml
index 8b97592..05cc691 100644
--- a/cdn-services/cdn-local/templates/nginx.yaml
+++ b/cdn-services/cdn-local/templates/nginx.yaml
@@ -43,12 +43,10 @@
         app: nginx-rtmp
       annotations:
         k8s.v1.cni.cncf.io/networks: '[
-            { "name": "sgi-net-nd", "interface": "sgi-net-nd" }
+            { "name": "sgi-net-nd", "interface": "sgi-net-nd", "ips": {{ .Values.networks.sgi_net_nd.ip | quote }} }
         ]'
     spec:
       #hostNetwork: true
-      nodeSelector:
-{{ toYaml .Values.nginx.nodeselector | indent 8 }}
       terminationGracePeriodSeconds: 0
       imagePullSecrets:
       - name: nexus-docker-secret
@@ -104,4 +102,4 @@
           - key: nginx.conf
             path: nginx.conf
       - name: shared-volume
-        emptyDir: {}
\ No newline at end of file
+        emptyDir: {}
diff --git a/cdn-services/cdn-local/values.yaml b/cdn-services/cdn-local/values.yaml
index b790a9c..27cbf7a 100644
--- a/cdn-services/cdn-local/values.yaml
+++ b/cdn-services/cdn-local/values.yaml
@@ -18,7 +18,7 @@
 
 remote_ip: 10.90.0.132
 stream_name: 1.stream
-spgwu_sgiip: 13.0.0.83
+spgwu_sgiip: 13.1.1.3
 ue_ip_subnet1: 16.0.0.0/8
 ue_ip_subnet2: 17.0.0.0/8
 etcdurl: http://node1:32379
@@ -30,15 +30,13 @@
     rtmp_orig: 1935
     rtmp_np: 31935
   replicas: 1
-  nodeselector:
-    sriov: netdevice
 
-network:
+networks:
   sriov:
     enabled: true
-  networks:
-    - name: sgi-net-nd
-      type: sriov
-      ipam: centralip
-      subnet: 13.1.1.0/24
-      gateway: 13.1.1.254
\ No newline at end of file
+  sgi_net_nd:
+    type: sriov
+    ipam: static
+    ip: 13.1.1.253/24
+    subnet: 13.1.1.0/24
+    gateway: 13.1.1.254