changed policy k8s deployment to support helm parameterization. updated images to 1.1
Issue-ID: OOM-52
Change-Id: I4eb0626c7c00ace2c266d6ddbb1313f3b654d69e
Signed-off-by: kerenj <keren.joseph@amdocs.com>
 #!/bin/bash
 
-HELM_APPS=('mso' 'message-router' 'sdnc' 'vid' 'robot' 'portal')
-ONAP_APPS=('sdc' 'aai' 'policy' 'appc')
+HELM_APPS=('mso' 'message-router' 'sdnc' 'vid' 'robot' 'portal' 'policy')
+ONAP_APPS=('sdc' 'aai' 'appc')
 ONAP_DOCKER_REGISTRY_KEY=${ONAP_DOCKER_REGISTRY_KEY:-onap-docker-registry-key}
 ONAP_DOCKER_REGISTRY=${ONAP_DOCKER_REGISTRY:-nexus3.onap.org:10001}
 ONAP_DOCKER_USER=${ONAP_DOCKER_USER:-docker}
 
--- /dev/null
+apiVersion: v1
+description: A Helm chart for Kubernetes
+name: policy
+version: 0.1.0
 
 kind: Service
 metadata:
   name: mariadb
+  namespace: {{ .Values.NS }}
   labels:
     app: mariadb
 spec:
   labels:
     app: nexus
   name: nexus
+  namespace: {{ .Values.NS }}
 spec:
   ports:
   - name: nexus-port
   labels:
     app: drools
   name: drools
+  namespace: {{ .Values.NS }}
 spec:
   ports:
   - name: "drools-port"
 kind: Service
 metadata:
   name: pap
+  namespace: {{ .Values.NS }}
   labels:
     app: pap
 spec:
 kind: Service
 metadata:
   name: pdp
+  namespace: {{ .Values.NS }}
   labels:
     app: pdp
 spec:
 kind: Service
 metadata:
   name: pypdp
+  namespace: {{ .Values.NS }}
   labels:
     app: pypdp
 spec:
 kind: Service
 metadata:
   name: brmsgw
+  namespace: {{ .Values.NS }}
   labels:
     app: brmsgw
 spec:
 
 kind: Deployment
 metadata:
   name: brmsgw
+  namespace: {{ .Values.NS }}
 spec:
   replicas: 1
   selector:
                       }
                   }
               ],
-              "image": "oomk8s/readiness-check:1.0.0",
-              "imagePullPolicy": "Always",
+              "image": "{{ .Values.image.readiness }}",
+              "imagePullPolicy": "{{ .Values.pullPolicy }}",
               "name": "brmsgw-readiness"
           }
           ]'
         - /bin/bash
         - ./do-start.sh
         - brmsgw
-        image: nexus3.onap.org:10001/openecomp/policy/policy-pe:1.0-STAGING-latest
+        image: {{ .Values.image.policyPe }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
         name: brmsgw
         volumeMounts:
         - mountPath: /tmp/policy-install/config
       volumes:
         - name: pe
           hostPath:
-            path: /dockerdata-nfs/onapdemo/policy/opt/policy/config/pe/
+            path: /dockerdata-nfs/onap/policy/opt/policy/config/pe/
       imagePullSecrets:
       - name: onap-docker-registry-key
 
 kind: Deployment
 metadata:
   name: drools
+  namespace: {{ .Values.NS }}
 spec:
   replicas: 1
   selector:
                       }
                   }
               ],
-              "image": "oomk8s/readiness-check:1.0.0",
-              "imagePullPolicy": "Always",
+              "image": "{{ .Values.image.readiness }}",
+              "imagePullPolicy": "{{ .Values.pullPolicy }}",
               "name": "drools-readiness"
           }
           ]'
         - /bin/bash
         - -c
         - ./do-start.sh
-        image: nexus3.onap.org:10001/openecomp/policy/policy-drools:1.0-STAGING-latest
+        image: {{ .Values.image.policyDrools }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
         name: drools
         ports:
         - containerPort: 6969
       volumes:
         - name: drools-settingsxml
           hostPath:
-            path:  /dockerdata-nfs/onapdemo/policy/drools/settings.xml
+            path:  /dockerdata-nfs/onap/policy/drools/settings.xml
         - name: drools
           hostPath:
-            path:  /dockerdata-nfs/onapdemo/policy/opt/policy/config/drools/
+            path:  /dockerdata-nfs/onap/policy/opt/policy/config/drools/
       imagePullSecrets:
       - name: onap-docker-registry-key
 
 kind: Deployment
 metadata:
   name: mariadb
+  namespace: {{ .Values.NS }}
 spec:
   replicas: 1
   selector:
         - /bin/bash
         - -c
         - exec bash /tmp/do-start.sh
-        image: nexus3.onap.org:10001/openecomp/policy/policy-db:1.0-STAGING-latest
+        image: {{ .Values.image.policyDb }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
         name: mariadb
         ports:
         - containerPort: 3306
 
 kind: Deployment
 metadata:
   name: nexus
+  namespace: {{ .Values.NS }}
 spec:
   selector:
     matchLabels:
                       }
                   }
               ],
-              "image": "oomk8s/readiness-check:1.0.0",
-              "imagePullPolicy": "Always",
+              "image": "{{ .Values.image.readiness }}",
+              "imagePullPolicy": "{{ .Values.pullPolicy }}",
               "name": "nexus-readiness"
           }
           ]'
         - /bin/bash
         - -c
         - bash -c "/opt/nexus/nexus-2.14.2-01/bin/nexus start && sleep 1000d"
-        image: nexus3.onap.org:10001/openecomp/policy/policy-nexus:1.0-STAGING-latest
+        image: {{ .Values.image.policyNexus }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
         name: nexus
       imagePullSecrets:
       - name: onap-docker-registry-key
 
 kind: Deployment
 metadata:
   name: pap
+  namespace: {{ .Values.NS }}
 spec:
   selector:
     matchLabels:
                       }
                   }
               ],
-              "image": "oomk8s/readiness-check:1.0.0",
-              "imagePullPolicy": "Always",
+              "image": "{{ .Values.image.readiness }}",
+              "imagePullPolicy": "{{ .Values.pullPolicy }}",
               "name": "pap-readiness"
           },
           {
                   "name": "pe"
                 }
               ],
-              "image": "ubuntu:16.04",
-              "imagePullPolicy": "Always",
+              "image": "{{ .Values.image.ubuntu }}",
+              "imagePullPolicy": "{{ .Values.pullPolicy }}",
               "name": "generate-ip-addr-txt"
           }
           ]'
         - /bin/bash
         - ./do-start.sh
         - pap
-        image: nexus3.onap.org:10001/openecomp/policy/policy-pe:1.0-STAGING-latest
+        image: {{ .Values.image.policyPe }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
         name: pap
         ports:
         - containerPort: 8443
       volumes:
         - name: pe
           hostPath:
-            path: /dockerdata-nfs/onapdemo/policy/opt/policy/config/pe/
+            path: /dockerdata-nfs/onap/policy/opt/policy/config/pe/
       imagePullSecrets:
       - name: onap-docker-registry-key
 
 kind: Deployment
 metadata:
   name: pdp
+  namespace: {{ .Values.NS }}
 spec:
   replicas: 1
   selector:
                       }
                   }
               ],
-              "image": "oomk8s/readiness-check:1.0.0",
-              "imagePullPolicy": "Always",
+              "image": "{{ .Values.image.readiness }}",
+              "imagePullPolicy": "{{ .Values.pullPolicy }}",
               "name": "pdp-readiness"
           }
           ]'
         - /bin/bash
         - ./do-start.sh
         - pdp
-        image: nexus3.onap.org:10001/openecomp/policy/policy-pe:1.0-STAGING-latest
+        image: {{ .Values.image.policyPe }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
         name: pdp
         ports:
         - containerPort: 8081
       volumes:
         - name: pe
           hostPath:
-            path: /dockerdata-nfs/onapdemo/policy/opt/policy/config/pe/
+            path: /dockerdata-nfs/onap/policy/opt/policy/config/pe/
       imagePullSecrets:
       - name: onap-docker-registry-key
 
 kind: Deployment
 metadata:
   name: pypdp
+  namespace: {{ .Values.NS }}
 spec:
   replicas: 1
   selector:
                       }
                   }
               ],
-              "image": "oomk8s/readiness-check:1.0.0",
-              "imagePullPolicy": "Always",
+              "image": "{{ .Values.image.readiness }}",
+              "imagePullPolicy": "{{ .Values.pullPolicy }}",
               "name": "pypdp-readiness"
           }
           ]'
         - /bin/bash
         - ./do-start.sh
         - pypdp
-        image: nexus3.onap.org:10001/openecomp/policy/policy-pe:1.0-STAGING-latest
+        image: {{ .Values.image.policyPe }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
         name: pypdp
         ports:
         - containerPort: 8480
       volumes:
         - name: pe
           hostPath:
-            path: /dockerdata-nfs/onapdemo/policy/opt/policy/config/pe/
+            path: /dockerdata-nfs/onap/policy/opt/policy/config/pe/
       imagePullSecrets:
       - name: onap-docker-registry-key
 
--- /dev/null
+NS: onap-policy
+pullPolicy: Always
+image:
+  readiness: oomk8s/readiness-check:1.0.0
+  policyPe: nexus3.onap.org:10001/openecomp/policy/policy-pe:1.1-STAGING-latest
+  policyDrools: nexus3.onap.org:10001/openecomp/policy/policy-drools:1.1-STAGING-latest
+  policyDb: nexus3.onap.org:10001/openecomp/policy/policy-db:1.1-STAGING-latest
+  policyNexus: nexus3.onap.org:10001/openecomp/policy/policy-nexus:1.1-STAGING-latest
+  ubuntu: ubuntu:16.04