Policy 1.1 in Kubernetes

- up verion containers to use 1.1
- pap and brmsgw report it is waiting for pap 9091 port to be open but pdp and pypdp reports pap 9091 port is open
- removed push-policies.sh from 1.1 due to comment in CR
- removed pypdp container from 1.1 due to comment in CR
- removed pypdp.conf from 1.1 due to comment in CR
- removed ip_addr.txt from 1.1 due to comment in CR

Change-Id: Ibb685ec603a59dba56aa9673044ae1923d993191
Issue-Id: OOM-249
Signed-off-by: Eric Au <kachun.au@amdocs.com>
diff --git a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/brmsgw.conf b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/brmsgw.conf
index c69b4f0..8c70090 100755
--- a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/brmsgw.conf
+++ b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/brmsgw.conf
@@ -4,8 +4,8 @@
 COMPONENT_X_MX_MB=1024
 COMPONENT_X_MS_MB=1024
 
-REST_PAP_URL=http://pap:9091/pap/
-REST_PDP_ID=http://pdp:8081/pdp/
+REST_PAP_URL=http://pap.onap-policy:9091/pap/
+REST_PDP_ID=http://pdp.onap-policy:8081/pdp/
 
 PDP_HTTP_USER_ID=testpdp
 PDP_HTTP_PASSWORD=alpha123
diff --git a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/console.conf b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/console.conf
index e53082b..35867eb 100755
--- a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/console.conf
+++ b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/console.conf
@@ -85,7 +85,7 @@
 
 REST_CONFIG_HOME=${{POLICY_HOME}}/servers/pap/webapps/Config/
 REST_ACTION_HOME=${{POLICY_HOME}}/servers/pap/webapps/Action/
-REST_CONFIG_URL=http://pap:9091/
+REST_CONFIG_URL=http://pap.onap-policy:9091/
 REST_CONFIG_WEBAPPS=${{POLICY_HOME}}/servers/pap/webapps/
 
 # PAP account information
diff --git a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/ip_addr.txt b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/ip_addr.txt
deleted file mode 100755
index 8fde4a8..0000000
--- a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/ip_addr.txt
+++ /dev/null
@@ -1 +0,0 @@
-192.168.141.230
diff --git a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pap.conf b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pap.conf
index 084f127..53c52aa 100755
--- a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pap.conf
+++ b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pap.conf
@@ -14,7 +14,7 @@
 # pap properties
 
 PAP_PDPS=${{POLICY_HOME}}/servers/pap/bin/pdps
-PAP_URL=http://pap:9091/pap/
+PAP_URL=http://pap.onap-policy:9091/pap/
 
 PAP_INITIATE_PDP=true
 PAP_HEARTBEAT_INTERVAL=10000
@@ -26,7 +26,7 @@
 
 # PDP related properties
 
-PAP_PDP_URL=http://pdp:8081/pdp/
+PAP_PDP_URL=http://pdp.onap-policy:8081/pdp/
 PAP_PDP_HTTP_USER_ID=testpdp
 PAP_PDP_HTTP_PASSWORD=alpha123
 
diff --git a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/paplp.conf b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/paplp.conf
index 9fdd643..d25f11b 100755
--- a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/paplp.conf
+++ b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/paplp.conf
@@ -3,7 +3,7 @@
 LOGPARSER_X_MS_MB=1024
 LOGPARSER_X_MX_MB=1024
 
-SERVER=http://pap:9091/pap/
+SERVER=http://pap.onap-policy:9091/pap/
 LOGPATH=${{POLICY_HOME}}/servers/pap/logs/pap-rest.log
 PARSERLOGPATH=IntegrityMonitor.log
 
diff --git a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pdp.conf b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pdp.conf
index 8f64457..9d56d49 100755
--- a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pdp.conf
+++ b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pdp.conf
@@ -15,8 +15,8 @@
 
 UEB_CLUSTER=dmaap.onap-message-router
 
-REST_PAP_URL=http://pap:9091/pap/
-REST_PDP_ID=http://pdp:8081/pdp/
+REST_PAP_URL=http://pap.onap-policy:9091/pap/
+REST_PDP_ID=http://pdp.onap-policy:8081/pdp/
 REST_PDP_CONFIG=${{POLICY_HOME}}/servers/pdp/bin/config
 REST_PDP_WEBAPPS=${{POLICY_HOME}}/servers/pdp/webapps
 REST_PDP_REGISTER=true
diff --git a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pdplp.conf b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pdplp.conf
index 789d2b0..8320caa 100755
--- a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pdplp.conf
+++ b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pdplp.conf
@@ -3,7 +3,7 @@
 LOGPARSER_X_MS_MB=1024
 LOGPARSER_X_MX_MB=1024
 
-SERVER=http://pdp:8081/pdp/
+SERVER=http://pdp.onap-policy:8081/pdp/
 LOGPATH=${{POLICY_HOME}}/servers/pdp/logs/pdp-rest.log
 PARSERLOGPATH=IntegrityMonitor.log
 
diff --git a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/push-policies.sh b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/push-policies.sh
deleted file mode 100755
index 957156e..0000000
--- a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/push-policies.sh
+++ /dev/null
@@ -1,75 +0,0 @@
-#! /bin/bash
-
-
-echo "Pushing default policies"
-
-# Sometimes brmsgw gets an error when trying to retrieve the policies on initial push,
-# so for the BRMS policies we will do a push, then delete from the pdp group, then push again.
-# Second push should be successful.
-
-curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
-  "pdpGroup": "default",
-  "policyName": "vFirewall",
-  "policyScope": "com",
-  "policyType": "MicroService"
-}' 'http://pypdp:8480/PyPDPServer/pushPolicy'
-
-sleep 2
-
-curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
-  "pdpGroup": "default",
-  "policyName": "vLoadBalancer",
-  "policyScope": "com",
-  "policyType": "MicroService"
-}' 'http://pypdp:8480/PyPDPServer/pushPolicy' 
-
-sleep 2
-curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
-  "pdpGroup": "default",
-  "policyName": "BRMSParamvLBDemoPolicy",
-  "policyScope": "com",
-  "policyType": "BRMS_Param"
-}' 'http://pypdp:8480/PyPDPServer/pushPolicy'
-
-sleep 2
-
-curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
-  "pdpGroup": "default",
-  "policyName": "BRMSParamvFWDemoPolicy",
-  "policyScope": "com",
-  "policyType": "BRMS_Param"
-}' 'http://pypdp:8480/PyPDPServer/pushPolicy'
-
-sleep 2
-
-curl -X DELETE --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
-"pdpGroup": "default",
-"policyComponent": "PDP",
-"policyName": "com.Config_BRMS_Param_BRMSParamvFWDemoPolicy.1.xml"
-}' 'http://pypdp:8480/PyPDPServer/deletePolicy'
-
-
-
-curl -X DELETE --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
-"pdpGroup": "default",
-"policyComponent": "PDP",
-"policyName": "com.Config_BRMS_Param_BRMSParamvLBDemoPolicy.1.xml"
-}' 'http://pypdp:8480/PyPDPServer/deletePolicy'
-
-sleep 2
-curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
-  "pdpGroup": "default",
-  "policyName": "BRMSParamvLBDemoPolicy",
-  "policyScope": "com",
-  "policyType": "BRMS_Param"
-}' 'http://pypdp:8480/PyPDPServer/pushPolicy'
-
-sleep 2
-
-curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
-  "pdpGroup": "default",
-  "policyName": "BRMSParamvFWDemoPolicy",
-  "policyScope": "com",
-  "policyType": "BRMS_Param"
-}' 'http://pypdp:8480/PyPDPServer/pushPolicy'
-
diff --git a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pypdp.conf b/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pypdp.conf
deleted file mode 100755
index 4a792b4..0000000
--- a/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/pypdp.conf
+++ /dev/null
@@ -1,25 +0,0 @@
-# pypdp component installation configuration parameters
-
-# tomcat specific parameters
-
-TOMCAT_JMX_PORT=9994
-TOMCAT_SHUTDOWN_PORT=8405
-SSL_HTTP_CONNECTOR_PORT=8480
-SSL_AJP_CONNECTOR_PORT=8384
-SSL_AJP_CONNECTOR_REDIRECT_PORT=8443
-
-TOMCAT_X_MS_MB=1024
-TOMCAT_X_MX_MB=1024
-
-# pypdp parameters
-
-PDP_URL=http://pdp:8081/pdp/,testpdp,alpha123
-PAP_URL=http://pap:9091/pap/,testpap,alpha123
-PYPDP_ID=testrest
-PYPDP_PASSWORD=3c0mpU#h01@N1c3
-
-node_type=pypdp
-# the java property is RESOURCE_NAME (uppercase), but the conf parameter is lowercase
-resource_name=pypdp_1
-
-CLIENT_FILE=client.properties
diff --git a/kubernetes/policy/templates/dep-brmsgw.yaml b/kubernetes/policy/templates/dep-brmsgw.yaml
index e535cf2..17e4896 100644
--- a/kubernetes/policy/templates/dep-brmsgw.yaml
+++ b/kubernetes/policy/templates/dep-brmsgw.yaml
@@ -24,9 +24,7 @@
                   "--container-name",
                   "pap",
                   "--container-name",
-                  "pdp",
-                  "--container-name",
-                  "pypdp"
+                  "pdp"
               ],
               "command": [
                   "/root/ready.py"
@@ -42,7 +40,7 @@
                       }
                   }
               ],
-              "image": "{{ .Values.image.readiness }}",
+              "image": "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}",
               "imagePullPolicy": "{{ .Values.pullPolicy }}",
               "name": "brmsgw-readiness"
           }
@@ -53,7 +51,7 @@
         - /bin/bash
         - ./do-start.sh
         - brmsgw
-        image: {{ .Values.image.policyPe }}
+        image: "{{ .Values.image.policyPe }}:{{ .Values.image.policyPeVersion}}"
         imagePullPolicy: {{ .Values.pullPolicy }}
         name: brmsgw
         volumeMounts:
diff --git a/kubernetes/policy/templates/dep-drools.yaml b/kubernetes/policy/templates/dep-drools.yaml
index 96eb5f0..75055c1 100644
--- a/kubernetes/policy/templates/dep-drools.yaml
+++ b/kubernetes/policy/templates/dep-drools.yaml
@@ -26,8 +26,6 @@
                   "--container-name",
                   "pdp",
                   "--container-name",
-                  "pypdp",
-                  "--container-name",
                   "brmsgw"
               ],
               "command": [
@@ -44,7 +42,7 @@
                       }
                   }
               ],
-              "image": "{{ .Values.image.readiness }}",
+              "image": "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}",
               "imagePullPolicy": "{{ .Values.pullPolicy }}",
               "name": "drools-readiness"
           }
@@ -55,7 +53,7 @@
         - /bin/bash
         - -c
         - ./do-start.sh
-        image: {{ .Values.image.policyDrools }}
+        image: "{{ .Values.image.policyDrools }}:{{ .Values.image.policyDroolsVersion }}"
         imagePullPolicy: {{ .Values.pullPolicy }}
         name: drools
         ports:
diff --git a/kubernetes/policy/templates/dep-maria.yaml b/kubernetes/policy/templates/dep-maria.yaml
index abbfdd8..511405b 100644
--- a/kubernetes/policy/templates/dep-maria.yaml
+++ b/kubernetes/policy/templates/dep-maria.yaml
@@ -19,7 +19,7 @@
         - /bin/bash
         - -c
         - exec bash /tmp/do-start.sh
-        image: {{ .Values.image.policyDb }}
+        image: "{{ .Values.image.policyDb }}:{{ .Values.image.policyDbVersion }}"
         imagePullPolicy: {{ .Values.pullPolicy }}
         name: mariadb
         ports:
diff --git a/kubernetes/policy/templates/dep-nexus.yaml b/kubernetes/policy/templates/dep-nexus.yaml
index 4507508..de067b1 100644
--- a/kubernetes/policy/templates/dep-nexus.yaml
+++ b/kubernetes/policy/templates/dep-nexus.yaml
@@ -33,7 +33,7 @@
                       }
                   }
               ],
-              "image": "{{ .Values.image.readiness }}",
+              "image": "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}",
               "imagePullPolicy": "{{ .Values.pullPolicy }}",
               "name": "nexus-readiness"
           }
@@ -44,7 +44,7 @@
         - /bin/bash
         - -c
         - bash -c "/opt/nexus/nexus-2.14.2-01/bin/nexus start && sleep 1000d"
-        image: {{ .Values.image.policyNexus }}
+        image: "{{ .Values.image.policyNexus }}:{{ .Values.image.policyNexusVersion }}"
         imagePullPolicy: {{ .Values.pullPolicy }}
         name: nexus
       imagePullSecrets:
diff --git a/kubernetes/policy/templates/dep-pap.yaml b/kubernetes/policy/templates/dep-pap.yaml
index 8ee2370..fcb590b 100644
--- a/kubernetes/policy/templates/dep-pap.yaml
+++ b/kubernetes/policy/templates/dep-pap.yaml
@@ -35,7 +35,7 @@
                       }
                   }
               ],
-              "image": "{{ .Values.image.readiness }}",
+              "image": "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}",
               "imagePullPolicy": "{{ .Values.pullPolicy }}",
               "name": "pap-readiness"
           },
@@ -69,7 +69,7 @@
         - /bin/bash
         - ./do-start.sh
         - pap
-        image: {{ .Values.image.policyPe }}
+        image: "{{ .Values.image.policyPe }}:{{ .Values.image.policyPeVersion }}"
         imagePullPolicy: {{ .Values.pullPolicy }}
         name: pap
         ports:
diff --git a/kubernetes/policy/templates/dep-pdp.yaml b/kubernetes/policy/templates/dep-pdp.yaml
index c5ea267..c8a4f71 100644
--- a/kubernetes/policy/templates/dep-pdp.yaml
+++ b/kubernetes/policy/templates/dep-pdp.yaml
@@ -38,7 +38,7 @@
                       }
                   }
               ],
-              "image": "{{ .Values.image.readiness }}",
+              "image": "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}",
               "imagePullPolicy": "{{ .Values.pullPolicy }}",
               "name": "pdp-readiness"
           }
@@ -49,7 +49,7 @@
         - /bin/bash
         - ./do-start.sh
         - pdp
-        image: {{ .Values.image.policyPe }}
+        image: "{{ .Values.image.policyPe }}:{{ .Values.image.policyPeVersion }}"
         imagePullPolicy: {{ .Values.pullPolicy }}
         name: pdp
         ports:
diff --git a/kubernetes/policy/templates/dep-pypdp.yaml b/kubernetes/policy/templates/dep-pypdp.yaml
deleted file mode 100644
index 4e2c9b6..0000000
--- a/kubernetes/policy/templates/dep-pypdp.yaml
+++ /dev/null
@@ -1,72 +0,0 @@
-apiVersion: extensions/v1beta1
-kind: Deployment
-metadata:
-  name: pypdp
-  namespace: "{{ .Values.nsPrefix }}-policy"
-spec:
-  replicas: 1
-  selector:
-    matchLabels:
-      app: pypdp
-  template:
-    metadata:
-      labels:
-        app: pypdp
-      name: pypdp
-      annotations:
-        pod.beta.kubernetes.io/init-containers: '[
-          {
-              "args": [
-                  "--container-name",
-                  "mariadb",
-                  "--container-name",
-                  "nexus",
-                  "--container-name",
-                  "pap",
-                  "--container-name",
-                  "pdp"
-              ],
-              "command": [
-                  "/root/ready.py"
-              ],
-              "env": [
-                  {
-                      "name": "NAMESPACE",
-                      "valueFrom": {
-                          "fieldRef": {
-                              "apiVersion": "v1",
-                              "fieldPath": "metadata.namespace"
-                          }
-                      }
-                  }
-              ],
-              "image": "{{ .Values.image.readiness }}",
-              "imagePullPolicy": "{{ .Values.pullPolicy }}",
-              "name": "pypdp-readiness"
-          }
-          ]'
-    spec:
-      containers:
-      - command:
-        - /bin/bash
-        - ./do-start.sh
-        - pypdp
-        image: {{ .Values.image.policyPe }}
-        imagePullPolicy: {{ .Values.pullPolicy }}
-        name: pypdp
-        ports:
-        - containerPort: 8480
-        readinessProbe:
-          tcpSocket:
-            port: 8480
-          initialDelaySeconds: 5
-          periodSeconds: 10
-        volumeMounts:
-        - mountPath: /tmp/policy-install/config
-          name: pe
-      volumes:
-        - name: pe
-          hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/policy/opt/policy/config/pe/
-      imagePullSecrets:
-      - name: "{{ .Values.nsPrefix }}-docker-registry-key"
diff --git a/kubernetes/policy/values.yaml b/kubernetes/policy/values.yaml
index 0f990c9..e11ad74 100644
--- a/kubernetes/policy/values.yaml
+++ b/kubernetes/policy/values.yaml
@@ -1,9 +1,14 @@
 nsPrefix: onap
 pullPolicy: Always
 image:
-  readiness: oomk8s/readiness-check:1.0.0
-  policyPe: nexus3.onap.org:10001/openecomp/policy/policy-pe:1.0-STAGING-latest
-  policyDrools: nexus3.onap.org:10001/openecomp/policy/policy-drools:1.0-STAGING-latest
-  policyDb: nexus3.onap.org:10001/openecomp/policy/policy-db:1.0-STAGING-latest
-  policyNexus: nexus3.onap.org:10001/openecomp/policy/policy-nexus:1.0-STAGING-latest
+  readiness: oomk8s/readiness-check
+  readinessVersion: 1.0.0
+  policyPe: nexus3.onap.org:10001/openecomp/policy/policy-pe
+  policyPeVersion: 1.1-STAGING-latest
+  policyDrools: nexus3.onap.org:10001/openecomp/policy/policy-drools
+  policyDroolsVersion: 1.1-STAGING-latest
+  policyDb: nexus3.onap.org:10001/openecomp/policy/policy-db
+  policyDbVersion: 1.1-STAGING-latest
+  policyNexus: nexus3.onap.org:10001/openecomp/policy/policy-nexus
+  policyNexusVersion: 1.1-STAGING-latest
   ubuntu: ubuntu:16.04