From c735dd1ffafd4a95b68efd0316504b7859e24b94 Mon Sep 17 00:00:00 2001 From: hackerman <3372410+aeneasr@users.noreply.github.com> Date: Sat, 2 Nov 2019 15:00:05 +0100 Subject: [PATCH] helm: Add ability to set deployment labels and annotations (#79) --- helm/charts/hive/templates/deployment.yaml | 14 ++++++++++++++ helm/charts/hive/values.yaml | 10 +++++++++- helm/charts/hydra/templates/deployment.yaml | 10 ++++++++++ helm/charts/hydra/values.yaml | 5 +++++ helm/charts/oathkeeper/templates/deployment.yaml | 12 +++++++++++- helm/charts/oathkeeper/values.yaml | 11 ++++++++++- 6 files changed, 59 insertions(+), 3 deletions(-) diff --git a/helm/charts/hive/templates/deployment.yaml b/helm/charts/hive/templates/deployment.yaml index c946251b0..0494b8db4 100644 --- a/helm/charts/hive/templates/deployment.yaml +++ b/helm/charts/hive/templates/deployment.yaml @@ -5,6 +5,13 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{ include "hive.labels" . | indent 4 }} +{{- with .Values.deployment.labels }} + {{- toYaml . | nindent 4 }} +{{- end }} +{{- with .Values.deployment.annotations }} + annotations: + {{- toYaml . | nindent 4 }} +{{- end }} spec: replicas: {{ .Values.replicaCount }} selector: @@ -16,6 +23,13 @@ spec: labels: app.kubernetes.io/name: {{ include "hive.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} + {{- with .Values.deployment.labels }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.deployment.annotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/helm/charts/hive/values.yaml b/helm/charts/hive/values.yaml index 5d13c654f..6fdc263ee 100644 --- a/helm/charts/hive/values.yaml +++ b/helm/charts/hive/values.yaml @@ -96,8 +96,16 @@ deployment: # Configure node tolerations. tolerations: [] - # Annotations + labels: {} + # If you do want to specify additional labels, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'labels:'. + # e.g. type: app + annotations: {} + # If you do want to specify annotations, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'annotations:'. + # e.g. sidecar.istio.io/rewriteAppHTTPProbers: "true" + # Configure node affinity affinity: {} diff --git a/helm/charts/hydra/templates/deployment.yaml b/helm/charts/hydra/templates/deployment.yaml index 67e5e69b0..581884535 100644 --- a/helm/charts/hydra/templates/deployment.yaml +++ b/helm/charts/hydra/templates/deployment.yaml @@ -5,6 +5,13 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{ include "hydra.labels" . | indent 4 }} +{{- with .Values.deployment.labels }} + {{- toYaml . | nindent 4 }} +{{- end }} +{{- with .Values.deployment.annotations }} + annotations: + {{- toYaml . | nindent 4 }} +{{- end }} spec: replicas: {{ .Values.replicaCount }} selector: @@ -16,6 +23,9 @@ spec: labels: app.kubernetes.io/name: {{ include "hydra.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} + {{- with .Values.deployment.labels }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.deployment.annotations }} annotations: {{- toYaml . | nindent 8 }} diff --git a/helm/charts/hydra/values.yaml b/helm/charts/hydra/values.yaml index e5e3914ac..602ff3d8e 100644 --- a/helm/charts/hydra/values.yaml +++ b/helm/charts/hydra/values.yaml @@ -116,6 +116,11 @@ deployment: # cpu: 100m # memory: 128Mi + labels: {} + # If you do want to specify additional labels, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'labels:'. + # e.g. type: app + annotations: {} # If you do want to specify annotations, uncomment the following # lines, adjust them as necessary, and remove the curly braces after 'annotations:'. diff --git a/helm/charts/oathkeeper/templates/deployment.yaml b/helm/charts/oathkeeper/templates/deployment.yaml index 7c4702f3c..6a4b6ca13 100644 --- a/helm/charts/oathkeeper/templates/deployment.yaml +++ b/helm/charts/oathkeeper/templates/deployment.yaml @@ -8,6 +8,13 @@ metadata: {{- end }} labels: {{ include "oathkeeper.labels" . | indent 4 }} +{{- with .Values.deployment.labels }} + {{- toYaml . | nindent 4 }} +{{- end }} +{{- with .Values.deployment.annotations }} + annotations: + {{- toYaml . | nindent 4 }} +{{- end }} spec: replicas: {{ .Values.replicaCount }} selector: @@ -19,10 +26,13 @@ spec: labels: app.kubernetes.io/name: {{ include "oathkeeper.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} + {{- with .Values.deployment.labels }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.deployment.annotations }} annotations: {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/helm/charts/oathkeeper/values.yaml b/helm/charts/oathkeeper/values.yaml index 0228a9054..e29c1b2e6 100644 --- a/helm/charts/oathkeeper/values.yaml +++ b/helm/charts/oathkeeper/values.yaml @@ -123,8 +123,17 @@ deployment: # Configure node tolerations. tolerations: [] - # Annotations + labels: {} + # If you do want to specify additional labels, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'labels:'. + # e.g. type: app + annotations: {} + # If you do want to specify annotations, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'annotations:'. + # e.g. sidecar.istio.io/rewriteAppHTTPProbers: "true" + + # Configure node affinity affinity: {}