[CORD-3026] Unify the usage of imagePullPolicy in helm-charts

Change-Id: I6135a81060eeb7f2831ce9c7207339f92017c10e
diff --git a/configs/onos-cord.yaml b/configs/onos-cord.yaml
index 764f143..e4d4fb9 100644
--- a/configs/onos-cord.yaml
+++ b/configs/onos-cord.yaml
@@ -16,8 +16,7 @@
 
 # Parameters for running ONOS with VTN
 #
-# helm install -f configs/onos-cord.yaml onos
+# helm install onos -f configs/onos-cord.yaml -n onos-cord
 
 # VTN is not working with 1.13 at present
-image:
-  tag: 1.12.0
+onosImage: 'onosproject/onos:1.12.0'
diff --git a/configs/onos-fabric.yaml b/configs/onos-fabric.yaml
index 8115b1d..ac25a5d 100644
--- a/configs/onos-fabric.yaml
+++ b/configs/onos-fabric.yaml
@@ -16,7 +16,7 @@
 
 # Expose ONOS services using NodePorts, for onos-fabric configuration
 #
-# helm install -f configs/onos-fabric.yaml onos
+# helm install onos -f configs/onos-fabric.yaml -n onos-fabric
 
 services:
   openflowServiceType: NodePort
diff --git a/configs/onos-voltha.yaml b/configs/onos-voltha.yaml
index 2bce674..3f7b95c 100644
--- a/configs/onos-voltha.yaml
+++ b/configs/onos-voltha.yaml
@@ -16,17 +16,15 @@
 
 # Expose ONOS services using NodePorts, for onos-voltha configuration
 #
-# helm install -f configs/onos-voltha.yaml onos
+# helm install onos -f configs/onos-voltha.yaml -n onos-voltha
+
 nameOverride: "onosv"
 fullnameOverride: "onos-voltha"
 
 namespace: voltha
 serviceAccountName: voltha-serviceaccount
 
-image:
-  repository: voltha/voltha-onos
-  tag: 'latest'
-  pullPolicy: IfNotPresent
+onosImage: 'voltha/voltha-onos:latest'
 
 services:
   openflowServiceType: ClusterIP
diff --git a/dhcp-server/templates/deployment.yaml b/dhcp-server/templates/deployment.yaml
index 9409a41..95a3b03 100644
--- a/dhcp-server/templates/deployment.yaml
+++ b/dhcp-server/templates/deployment.yaml
@@ -27,8 +27,8 @@
     spec:
       containers:
         - name: dhcp-server
-          image: {{ .Values.pull_docker_registry }}{{ .Values.images.dhcp_server.repository }}:{{ .Values.images.dhcp_server.tag }}
-          imagePullPolicy: {{ .Values.images.dhcp_server.pullPolicy }}
+          image: {{ .Values.dhcpServerImage }}
+          imagePullPolicy: {{ .Values.imagePullPolicy }}
           #command: ["/bin/bash", "-", "sleep 86400"]
           ports:
             - containerPort: 67
diff --git a/dhcp-server/values.yaml b/dhcp-server/values.yaml
index 2984f39..cc46338 100644
--- a/dhcp-server/values.yaml
+++ b/dhcp-server/values.yaml
@@ -12,13 +12,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-pull_docker_registry:
+# helm install dhcp-server -n dhcp-server
 
-images:
-  dhcp_server:
-    repository: networkboot/dhcpd
-    tag: 'latest'
-    pullPolicy: 'IfNotPresent'
+dhcpServerImage: 'networkboot/dhcpd:latest'
+imagePullPolicy: IfNotPresent
 
 config: |
 
diff --git a/examples/pull-always-values.yaml b/examples/pull-always-values.yaml
index 75a185a..de15672 100644
--- a/examples/pull-always-values.yaml
+++ b/examples/pull-always-values.yaml
@@ -16,7 +16,7 @@
 
 # Set all image tags to "candidate" to use imagebuilder's local images
 
-# in xos-core and rcord-lite charts
+# in xos-core, rcord-lite, onos and voltha charts
 imagePullPolicy: 'Always'
 
 # in service charts
@@ -34,3 +34,5 @@
   imagePullPolicy: 'Always'
 vrouter:
   imagePullPolicy: 'Always'
+xos-gui:
+  imagePullPolicy: 'Always'
diff --git a/onos/templates/deployment.yaml b/onos/templates/deployment.yaml
index 5d9e343..585b250 100644
--- a/onos/templates/deployment.yaml
+++ b/onos/templates/deployment.yaml
@@ -40,8 +40,8 @@
       serviceAccountName: {{ .Values.serviceAccountName }}
       containers:
         - name: {{ .Chart.Name }}
-          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
-          imagePullPolicy: {{ .Values.image.pullPolicy }}
+          image: {{ .Values.onosImage }}
+          imagePullPolicy: {{ .Values.imagePullPolicy }}
           env:
 {{ toYaml .Values.onos_env | indent 12 }}
           ports:
diff --git a/onos/values.yaml b/onos/values.yaml
index 601e46d..795176a 100644
--- a/onos/values.yaml
+++ b/onos/values.yaml
@@ -20,10 +20,8 @@
 
 replicaCount: 1
 
-image:
-  repository: onosproject/onos
-  tag: 1.13.1
-  pullPolicy: IfNotPresent
+imagePullPolicy: IfNotPresent
+onosImage: 'onosproject/onos:1.13.1'
 
 nameOverride: ""
 fullnameOverride: ""
diff --git a/voltha/templates/envoy_for_etcd.yaml b/voltha/templates/envoy_for_etcd.yaml
index 59bacdb..4869682 100644
--- a/voltha/templates/envoy_for_etcd.yaml
+++ b/voltha/templates/envoy_for_etcd.yaml
@@ -41,7 +41,8 @@
       serviceAccountName: {{ .Values.global.namespace }}-serviceaccount
       containers:
         - name: voltha
-          image: {{ .Values.pull_docker_registry }}{{ .Values.images.envoy_for_etcd.repository }}:{{ .Values.images.envoy_for_etcd.tag }}
+          image: {{ .Values.envoyForEtcdImage }}
+          imagePullPolicy: {{ .Values.imagePullPolicy }}
           env:
             - name: POD_IP
               valueFrom:
@@ -67,6 +68,5 @@
               name: mystery2-port
             - containerPort: 50555
               name: grpc-port
-          imagePullPolicy: {{ .Values.image_pull_policy }}
 
 
diff --git a/voltha/templates/freeradius.yaml b/voltha/templates/freeradius.yaml
index 10a32c6..6436303 100644
--- a/voltha/templates/freeradius.yaml
+++ b/voltha/templates/freeradius.yaml
@@ -55,7 +55,8 @@
       serviceAccountName: {{ .Values.global.namespace }}-serviceaccount
       containers:
         - name: freeradius
-          image: {{ .Values.pull_docker_registry }}{{ .Values.images.freeradius.repository }}:{{ .Values.images.freeradius.tag }}
+          image: {{ .Values.freeradiusImage }}
+          imagePullPolicy: {{ .Values.imagePullPolicy }}
           env:
             - name: POD_IP
               valueFrom:
diff --git a/voltha/templates/grafana.yaml b/voltha/templates/grafana.yaml
index 4fa7566..f4716bb 100644
--- a/voltha/templates/grafana.yaml
+++ b/voltha/templates/grafana.yaml
@@ -63,7 +63,8 @@
       serviceAccountName: {{ .Values.global.namespace }}-serviceaccount
       containers:
       - name: grafana
-        image: {{ .Values.pull_docker_registry }}{{ .Values.images.grafana.repository }}:{{ .Values.images.grafana.tag }}
+        image: {{ .Values.grafanaImage }}
+        imagePullPolicy: {{ .Values.imagePullPolicy }}
         ports:
         - containerPort: 80
         - containerPort: 2003
diff --git a/voltha/templates/netconf.yaml b/voltha/templates/netconf.yaml
index cacbf2e..acec48f 100644
--- a/voltha/templates/netconf.yaml
+++ b/voltha/templates/netconf.yaml
@@ -53,8 +53,8 @@
               topologyKey: kubernetes.io/hostname
       containers:
       - name: netconf
-        image: {{ .Values.pull_docker_registry }}{{ .Values.images.netconf.repository }}:{{ .Values.images.netconf.tag }}
-        imagePullPolicy: {{ .Values.image_pull_policy }}
+        image: {{ .Values.netconfImage }}
+        imagePullPolicy: {{ .Values.imagePullPolicy }}
         ports:
         - containerPort: 830
         env:
diff --git a/voltha/templates/ofagent.yaml b/voltha/templates/ofagent.yaml
index 124f0b4..9a2f836 100644
--- a/voltha/templates/ofagent.yaml
+++ b/voltha/templates/ofagent.yaml
@@ -41,8 +41,8 @@
             topologyKey: kubernetes.io/hostname
       containers:
       - name: ofagent
-        image: {{ .Values.pull_docker_registry }}{{ .Values.images.ofagent.repository }}:{{ .Values.images.ofagent.tag }}
-        imagePullPolicy: {{ .Values.image_pull_policy }}
+        image: {{ .Values.ofagentImage }}
+        imagePullPolicy: {{ .Values.imagePullPolicy }}
         env:
         - name: NAMESPACE
           valueFrom:
diff --git a/voltha/templates/stats.yaml b/voltha/templates/stats.yaml
index a7b9a70..51511a8 100644
--- a/voltha/templates/stats.yaml
+++ b/voltha/templates/stats.yaml
@@ -31,8 +31,8 @@
       serviceAccountName: {{ .Values.global.namespace }}-serviceaccount
       containers:
       - name: dashd
-        image: {{ .Values.pull_docker_registry }}{{ .Values.images.dashd.repository }}:{{ .Values.images.dashd.tag }}
-        imagePullPolicy: {{ .Values.image_pull_policy }}
+        image: {{ .Values.dashdImage }}
+        imagePullPolicy: {{ .Values.imagePullPolicy }}
         env:
         - name: NAMESPACE
           valueFrom:
@@ -64,8 +64,8 @@
       serviceAccountName: {{ .Values.global.namespace }}-serviceaccount
       containers:
       - name: shovel
-        image: {{ .Values.pull_docker_registry }}{{ .Values.images.shovel.repository }}:{{ .Values.images.shovel.tag }}
-        imagePullPolicy: {{ .Values.image_pull_policy }}
+        image: {{ .Values.shovelImage }}
+        imagePullPolicy: {{ .Values.imagePullPolicy }}
         env:
         - name: NAMESPACE
           valueFrom:
diff --git a/voltha/templates/vcli.yaml b/voltha/templates/vcli.yaml
index 5b8fbdb..4a9e9c7 100644
--- a/voltha/templates/vcli.yaml
+++ b/voltha/templates/vcli.yaml
@@ -48,7 +48,8 @@
       serviceAccountName: {{ .Values.global.namespace }}-serviceaccount
       containers:
         - name: vcli
-          image: {{ .Values.pull_docker_registry }}{{ .Values.images.vcli.repository }}:{{ .Values.images.vcli.tag }}
+          image: {{ .Values.vcliImage }}
+          imagePullPolicy: {{ .Values.imagePullPolicy }}
           env:
             - name: POD_IP
               valueFrom:
@@ -63,6 +64,5 @@
           ports:
             - containerPort: 22
               name: ssh-port
-          imagePullPolicy: {{ .Values.image_pull_policy }}
 
 
diff --git a/voltha/templates/vcore_for_etcd.yaml b/voltha/templates/vcore_for_etcd.yaml
index b9051ee..7f02fe0 100644
--- a/voltha/templates/vcore_for_etcd.yaml
+++ b/voltha/templates/vcore_for_etcd.yaml
@@ -53,7 +53,8 @@
       serviceAccountName: {{ .Values.global.namespace }}-serviceaccount
       containers:
         - name: voltha
-          image: {{ .Values.pull_docker_registry }}{{ .Values.images.vcore.repository }}:{{ .Values.images.vcore.tag }}
+          image: {{ .Values.vcoreImage }}
+          imagePullPolicy: {{ .Values.imagePullPolicy }}
           env:
             - name: NAMESPACE
               valueFrom:
@@ -77,6 +78,5 @@
               name: mystery-port
             - containerPort: 50556
               name: grpc-port
-          imagePullPolicy: {{ .Values.image_pull_policy }}
 
 
diff --git a/voltha/values.yaml b/voltha/values.yaml
index 8939b33..a666ea5 100644
--- a/voltha/values.yaml
+++ b/voltha/values.yaml
@@ -15,7 +15,7 @@
 pull_docker_registry:
 k8s_docker_registry: 'k8s.gcr.io/'
 
-image_pull_policy: IfNotPresent
+imagePullPolicy: IfNotPresent
 
 replicas:
   vcore: 1
@@ -51,41 +51,15 @@
   customResources:
     createEtcdClusterCRD: true
 
-images:
-  consul:
-    repository: consul
-    tag: '0.9.2'
-  envoy_for_etcd:
-    repository: voltha/voltha-envoy
-    tag: 'latest'
-  fluentd:
-    repository: fluentd-gcp
-    tag: '1.30'
-  freeradius:
-    repository: marcelmaatkamp/freeradius
-    tag: 'latest'
-  grafana:
-    repository: kamon/grafana_graphite
-    tag: '3.0'
-  netconf:
-    repository: voltha/voltha-netconf
-    tag: 'latest'
-  ofagent:
-    repository: voltha/voltha-ofagent
-    tag: 'latest'
-  dashd:
-    repository: voltha/voltha-dashd
-    tag: 'latest'
-  shovel:
-    repository: voltha/voltha-shovel
-    tag: 'latest'
-  vcli:
-    repository: voltha/voltha-cli
-    tag: 'latest'
-  vcore:
-    repository: voltha/voltha-voltha
-    tag: 'latest'
-    
+envoyForEtcdImage: 'voltha/voltha-envoy:latest'
+freeradiusImage: 'marcelmaatkamp/freeradius:latest'
+grafanaImage: 'kamon/grafana_graphite:3.0'
+netconfImage: 'voltha/voltha-netconf:latest'
+ofagentImage: 'voltha/voltha-ofagent:latest'
+dashdImage: 'voltha/voltha-dashd:latest'
+shovelImage: 'voltha/voltha-shovel:latest'
+vcliImage: 'voltha/voltha-cli:latest'
+vcoreImage: 'voltha/voltha-voltha:latest'
   
 kafka:
   enabled: true