VOL-1891 - support adding labels on install
Change-Id: Iff41309926de67691a2642904d53356e15d2531f
diff --git a/voltha-adapter-simulated/templates/adapters-simulated.yaml b/voltha-adapter-simulated/templates/adapters-simulated.yaml
index 4849648..4012c20 100644
--- a/voltha-adapter-simulated/templates/adapters-simulated.yaml
+++ b/voltha-adapter-simulated/templates/adapters-simulated.yaml
@@ -18,6 +18,19 @@
metadata:
name: adapter-simulated-olt
namespace: {{ .Release.Namespace }}
+ {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "simolt_deployment_labels") }}
+ labels:
+ {{- if hasKey .Values "extra_deployment_labels" }}
+ {{- range $key, $val := .Values.extra_deployment_labels }}
+ {{ $key }}: {{ $val | quote }}
+ {{- end }}
+ {{- end }}
+ {{- if hasKey .Values "simolt_deployment_labels" }}
+ {{- range $key, $val := .Values.simolt_deployment_labels }}
+ {{ $key }}: {{ $val | quote }}
+ {{- end }}
+ {{- end }}
+ {{- end }}
spec:
replicas: {{ .Values.replicas.adapter_simulated_olt }}
selector:
@@ -33,6 +46,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 "simolt_pod_labels" }}
+ {{- range $key, $val := .Values.simolt_pod_labels }}
+ {{ $key }}: {{ $val | quote }}
+ {{- end }}
+ {{- end }}
annotations:
cni: "calico"
spec:
@@ -57,6 +80,19 @@
metadata:
name: adapter-simulated-onu
namespace: {{ .Release.Namespace }}
+ {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "simonu_deployment_labels") }}
+ labels:
+ {{- if hasKey .Values "extra_deployment_labels" }}
+ {{- range $key, $val := .Values.extra_deployment_labels }}
+ {{ $key }}: {{ $val | quote }}
+ {{- end }}
+ {{- end }}
+ {{- if hasKey .Values "simonu_deployment_labels" }}
+ {{- range $key, $val := .Values.simonu_deployment_labels }}
+ {{ $key }}: {{ $val | quote }}
+ {{- end }}
+ {{- end }}
+ {{- end }}
spec:
replicas: {{ .Values.replicas.adapter_simulated_onu }}
selector:
@@ -72,6 +108,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 "simonu_pod_labels" }}
+ {{- range $key, $val := .Values.simonu_pod_labels }}
+ {{ $key }}: {{ $val | quote }}
+ {{- end }}
+ {{- end }}
annotations:
cni: "calico"
spec: