From 8ba105295d8cf0340b4d47db5d37ce76865b2eca Mon Sep 17 00:00:00 2001 From: Mugi <62197019+MugiOka@users.noreply.github.com> Date: Mon, 22 Mar 2021 18:27:59 +0900 Subject: [PATCH] feat: set service label from values (#233) This change was necessary because in order for kiali to draw the graph correctly, both the deployment label and the service label need to be labeled with the same app. --- helm/charts/hydra/templates/service-admin.yaml | 3 +++ helm/charts/hydra/templates/service-public.yaml | 3 +++ helm/charts/hydra/values.yaml | 8 ++++++++ helm/charts/oathkeeper/templates/service-api.yaml | 3 +++ helm/charts/oathkeeper/templates/service-proxy.yaml | 3 +++ helm/charts/oathkeeper/values.yaml | 9 +++++++++ 6 files changed, 29 insertions(+) diff --git a/helm/charts/hydra/templates/service-admin.yaml b/helm/charts/hydra/templates/service-admin.yaml index e8d989c0f..694f7f0c2 100644 --- a/helm/charts/hydra/templates/service-admin.yaml +++ b/helm/charts/hydra/templates/service-admin.yaml @@ -6,6 +6,9 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{ include "hydra.labels" . | indent 4 }} + {{- with .Values.service.admin.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- with .Values.service.admin.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/helm/charts/hydra/templates/service-public.yaml b/helm/charts/hydra/templates/service-public.yaml index 3c9280155..d15598f09 100644 --- a/helm/charts/hydra/templates/service-public.yaml +++ b/helm/charts/hydra/templates/service-public.yaml @@ -6,6 +6,9 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{ include "hydra.labels" . | indent 4 }} + {{- with .Values.service.public.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- with .Values.service.public.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/helm/charts/hydra/values.yaml b/helm/charts/hydra/values.yaml index 3145c84b5..89ce49e6a 100644 --- a/helm/charts/hydra/values.yaml +++ b/helm/charts/hydra/values.yaml @@ -35,6 +35,10 @@ service: annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" + 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. app: hydra # Configures the Kubernetes service for the api port. admin: # En-/disable the service @@ -48,6 +52,10 @@ service: annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" + 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. app: hydra # Configure ingress ingress: diff --git a/helm/charts/oathkeeper/templates/service-api.yaml b/helm/charts/oathkeeper/templates/service-api.yaml index 4c381c4a2..e32756bdb 100644 --- a/helm/charts/oathkeeper/templates/service-api.yaml +++ b/helm/charts/oathkeeper/templates/service-api.yaml @@ -8,6 +8,9 @@ metadata: {{- end }} labels: {{ include "oathkeeper.labels" . | indent 4 }} + {{- with .Values.service.api.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- with .Values.service.api.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/helm/charts/oathkeeper/templates/service-proxy.yaml b/helm/charts/oathkeeper/templates/service-proxy.yaml index e506e15fa..f53162b69 100644 --- a/helm/charts/oathkeeper/templates/service-proxy.yaml +++ b/helm/charts/oathkeeper/templates/service-proxy.yaml @@ -8,6 +8,9 @@ metadata: {{- end }} labels: {{ include "oathkeeper.labels" . | indent 4 }} + {{- with .Values.service.proxy.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- with .Values.service.proxy.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/helm/charts/oathkeeper/values.yaml b/helm/charts/oathkeeper/values.yaml index d752b2ceb..3e763ad51 100644 --- a/helm/charts/oathkeeper/values.yaml +++ b/helm/charts/oathkeeper/values.yaml @@ -50,6 +50,11 @@ service: annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" + 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. app: oathkeeper + # Configures the Kubernetes service for the api port. api: # En-/disable the service @@ -63,6 +68,10 @@ service: annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" + 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. app: oathkeeper # Configure ingress ingress: