Files
cluster-map/templates/dex-authenticator.yaml
T
Виталий ЧефановandClaude Opus 5.5 1025c40561 v0.8.1: request a kubernetes-audience token for actions
user-authn adds audience:server:client_id:kubernetes to the dex
authenticator's scope only for DexAuthenticators annotated
dexauthenticator.deckhouse.io/allow-access-to-kubernetes, which is what
the console module does. v0.8.0 set sendAuthorizationHeader alone, so the
token in the header was one the API server does not accept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 17:41:44 +03:00

50 lines
2.1 KiB
YAML

{{- $moduleGateway := dict }}
{{- include "helm_lib_module_gateway" (list . $moduleGateway) }}
{{- $ingressEnabled := eq (include "helm_lib_module_ingress_enabled" .) "true" }}
{{- $gatewayEnabled := eq (include "helm_lib_module_gateway_enabled" .) "true" }}
{{- if and .Values.clusterMap.internal.deployDexAuthenticator (or $ingressEnabled $gatewayEnabled) }}
---
apiVersion: deckhouse.io/v1
kind: DexAuthenticator
metadata:
name: cluster-map
namespace: d8-cluster-map
{{- include "helm_lib_module_labels" (list . (dict "app" "dex-authenticator" "name" "cluster-map")) | nindent 2 }}
{{- if .Values.clusterMap.actions.enabled }}
annotations:
# user-authn then asks Dex for a token with the kubernetes audience,
# which the API server accepts: actions run with it (as the console does)
dexauthenticator.deckhouse.io/allow-access-to-kubernetes: "true"
{{- end }}
spec:
applicationDomain: {{ include "helm_lib_module_public_domain" (list . "cluster-map") }}
{{- if and $ingressEnabled (include "helm_lib_module_https_ingress_tls_enabled" .) }}
applicationIngressCertificateSecretName: {{ include "helm_lib_module_https_secret_name" (list . "ingress-tls") }}
{{- end }}
{{- if and $gatewayEnabled (include "helm_lib_module_https_route_tls_enabled" .) }}
gatewayAPI:
applicationHTTPRouteListenerSetName: cluster-map
{{- end }}
applicationIngressClassName: {{ include "helm_lib_module_ingress_class" . | quote }}
{{- if .Values.clusterMap.actions.enabled }}
# actions run as the viewer: the user's token goes to the module in the
# Authorization header
sendAuthorizationHeader: true
{{- end }}
{{- with .Values.clusterMap.auth.allowedUserEmails }}
allowedEmails:
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- with .Values.clusterMap.auth.allowedUserGroups }}
allowedGroups:
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- with .Values.clusterMap.auth.whitelistSourceRanges }}
whitelistSourceRanges:
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- include "helm_lib_node_selector" (tuple . "system") | nindent 2 }}
{{- include "helm_lib_tolerations" (tuple . "system") | nindent 2 }}
highAvailability: false
{{- end }}