VOL-1891 - support adding labels on install

Change-Id: Iff41309926de67691a2642904d53356e15d2531f
diff --git a/voltha/templates/ofagent.yaml b/voltha/templates/ofagent.yaml
index a2d2086..ca8e5d5 100644
--- a/voltha/templates/ofagent.yaml
+++ b/voltha/templates/ofagent.yaml
@@ -18,6 +18,19 @@
 metadata:
   name: voltha-ofagent
   serviceAccountName: {{ .Values.serviceaccount }}
+  {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "ofagent_deployment_labels") }}
+  labels:
+    {{- if hasKey .Values "extra_deployment_labels" }}
+    {{- range $key, $val := .Values.extra_deployment_labels }}
+    {{ $key }}: {{ $val | quote }}
+    {{- end }}
+    {{- end }}
+    {{- if hasKey .Values "ofagent_deployment_labels" }}
+    {{- range $key, $val := .Values.ofagent_deployment_labels }}
+    {{ $key }}: {{ $val | quote }}
+    {{- end }}
+    {{- end }}
+  {{- end }}
 spec:
   replicas: {{ .Values.replicas.ofagent }}
   template:
@@ -30,6 +43,16 @@
         app.kubernetes.io/part-of: "voltha"
         app.kubernetes.io/managed-by: {{ quote .Release.Service }}
         helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+        {{- if hasKey .Values "extra_pod_labels" }}
+        {{- range $key, $val := .Values.extra_pod_labels }}
+        {{ $key }}: {{ $val | quote }}
+        {{- end }}
+        {{- end }}
+        {{- if hasKey .Values "ofagent_pod_labels" }}
+        {{- range $key, $val := .Values.ofagent_pod_labels }}
+        {{ $key }}: {{ $val | quote }}
+        {{- end }}
+        {{- end }}
       annotations:
         cni: "calico"
     spec: