diff --git a/helm/dex-app/templates/_helpers.tpl b/helm/dex-app/templates/_helpers.tpl index 8da64eef..44d2c1f6 100644 --- a/helm/dex-app/templates/_helpers.tpl +++ b/helm/dex-app/templates/_helpers.tpl @@ -25,7 +25,9 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} application.giantswarm.io/team: {{ index .Chart.Annotations "application.giantswarm.io/team" | quote }} giantswarm.io/service-type: "managed" {{- end -}} - +{{- define "dex-app.labels.common" -}} +{{ include "dex-app.labels.selector" . }} +{{- end -}} {{/* Selector dex labels */}} diff --git a/helm/dex-app/templates/dex/certs-secret.yaml b/helm/dex-app/templates/dex/certs-secret.yaml index b63ef0a0..2d9887f4 100644 --- a/helm/dex-app/templates/dex/certs-secret.yaml +++ b/helm/dex-app/templates/dex/certs-secret.yaml @@ -6,7 +6,7 @@ type: kubernetes.io/tls metadata: labels: {{- include "dex.labels.common" . | nindent 4 }} - {{- include "dex-app.labels.selector" . | nindent 4 }} + {{- include "dex-app.labels.common" . | nindent 4 }} name: {{ include "resource.dex.name" . }}-tls data: ca.crt: {{ .Values.ingress.tls.caPemB64 | quote }} diff --git a/helm/dex-app/templates/dex/clusterrole.yaml b/helm/dex-app/templates/dex/clusterrole.yaml index d6ca8a65..08e5abfa 100644 --- a/helm/dex-app/templates/dex/clusterrole.yaml +++ b/helm/dex-app/templates/dex/clusterrole.yaml @@ -3,7 +3,7 @@ kind: ClusterRole metadata: labels: {{- include "dex.labels.common" . | nindent 4 }} - {{- include "dex-app.labels.selector" . | nindent 4 }} + {{- include "dex-app.labels.common" . | nindent 4 }} name: {{ include "resource.dex.name" . }} rules: - apiGroups: ["dex.coreos.com"] # API group created by dex @@ -27,7 +27,7 @@ metadata: name: {{ include "resource.dex.name" . }}-metrics labels: {{- include "dex.labels.common" . | nindent 4 }} - {{- include "dex-app.labels.selector" . | nindent 4 }} + {{- include "dex-app.labels.common" . | nindent 4 }} rules: - nonResourceURLs: - "/metrics" diff --git a/helm/dex-app/templates/dex/clusterrolebinding.yaml b/helm/dex-app/templates/dex/clusterrolebinding.yaml index a1e84660..3c04b215 100644 --- a/helm/dex-app/templates/dex/clusterrolebinding.yaml +++ b/helm/dex-app/templates/dex/clusterrolebinding.yaml @@ -3,7 +3,7 @@ kind: ClusterRoleBinding metadata: labels: {{- include "dex.labels.common" . | nindent 4 }} - {{- include "dex-app.labels.selector" . | nindent 4 }} + {{- include "dex-app.labels.common" . | nindent 4 }} name: {{ include "resource.dex.name" . }} roleRef: apiGroup: rbac.authorization.k8s.io diff --git a/helm/dex-app/templates/dex/deployment.yaml b/helm/dex-app/templates/dex/deployment.yaml index 54737d7f..39ef2972 100644 --- a/helm/dex-app/templates/dex/deployment.yaml +++ b/helm/dex-app/templates/dex/deployment.yaml @@ -4,7 +4,7 @@ metadata: name: {{ include "resource.dex.name" . }} labels: {{- include "dex.labels.common" . | nindent 4 }} - {{- include "dex-app.labels.selector" . | nindent 4 }} + {{- include "dex-app.labels.common" . | nindent 4 }} annotations: app.giantswarm.io/secret-checksum: {{ include (print .Template.BasePath "/dex/secret.yaml") . | sha256sum | quote }} spec: @@ -17,11 +17,12 @@ spec: selector: matchLabels: {{- include "dex.labels.selector" . | nindent 6 }} + {{- include "dex-app.labels.selector" . | nindent 6 }} template: metadata: labels: {{- include "dex.labels.common" . | nindent 8 }} - {{- include "dex-app.labels.selector" . | nindent 8 }} + {{- include "dex-app.labels.common" . | nindent 8 }} annotations: checksum/config: {{ include (print .Template.BasePath "/dex/secret.yaml") . | sha256sum | quote }} spec: diff --git a/helm/dex-app/templates/dex/np.yaml b/helm/dex-app/templates/dex/np.yaml index c9023c6f..e9c3ec1a 100644 --- a/helm/dex-app/templates/dex/np.yaml +++ b/helm/dex-app/templates/dex/np.yaml @@ -4,7 +4,7 @@ metadata: name: {{ include "resource.dex.networkPolicy.name" . }} labels: {{- include "dex.labels.common" . | nindent 4 }} - {{- include "dex-app.labels.selector" . | nindent 4 }} + {{- include "dex-app.labels.common" . | nindent 4 }} spec: podSelector: matchLabels: diff --git a/helm/dex-app/templates/dex/psp.yaml b/helm/dex-app/templates/dex/psp.yaml index 6c4a5df2..28861501 100644 --- a/helm/dex-app/templates/dex/psp.yaml +++ b/helm/dex-app/templates/dex/psp.yaml @@ -4,7 +4,7 @@ kind: PodSecurityPolicy metadata: labels: {{- include "dex.labels.common" . | nindent 4 }} - {{- include "dex-app.labels.selector" . | nindent 4 }} + {{- include "dex-app.labels.common" . | nindent 4 }} name: {{ include "resource.dex.psp.name" . }} spec: privileged: false diff --git a/helm/dex-app/templates/dex/service-monitor.yaml b/helm/dex-app/templates/dex/service-monitor.yaml index aa51424f..ebb390f7 100644 --- a/helm/dex-app/templates/dex/service-monitor.yaml +++ b/helm/dex-app/templates/dex/service-monitor.yaml @@ -5,7 +5,7 @@ metadata: name: {{ include "resource.dex.name" . }} labels: {{- include "dex.labels.common" . | nindent 4 }} - {{- include "dex-app.labels.selector" . | nindent 4 }} + {{- include "dex-app.labels.common" . | nindent 4 }} spec: endpoints: - path: /metrics diff --git a/helm/dex-app/templates/dex/service.yaml b/helm/dex-app/templates/dex/service.yaml index 71c673d9..6ddb79a9 100644 --- a/helm/dex-app/templates/dex/service.yaml +++ b/helm/dex-app/templates/dex/service.yaml @@ -4,7 +4,7 @@ metadata: name: {{ include "resource.dex.name" . }} labels: {{- include "dex.labels.common" . | nindent 4 }} - {{- include "dex-app.labels.selector" . | nindent 4 }} + {{- include "dex-app.labels.common" . | nindent 4 }} giantswarm.io/monitoring: "true" annotations: giantswarm.io/monitoring-path: "/metrics" diff --git a/helm/dex-app/templates/dex/serviceaccount.yaml b/helm/dex-app/templates/dex/serviceaccount.yaml index 884fc312..f7937cb3 100644 --- a/helm/dex-app/templates/dex/serviceaccount.yaml +++ b/helm/dex-app/templates/dex/serviceaccount.yaml @@ -3,5 +3,5 @@ kind: ServiceAccount metadata: labels: {{- include "dex.labels.common" . | nindent 4 }} - {{- include "dex-app.labels.selector" . | nindent 4 }} + {{- include "dex-app.labels.common" . | nindent 4 }} name: {{ include "resource.dex.name" . }}