{{- if .Values.serviceAccountSecret.enabled -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "authentik-remote-cluster.fullname" . }}
  namespace: {{ include "authauthentik-remote-cluster.namespace" . | quote }}
  labels:
    {{- include "authentik-remote-cluster.labels" (dict "context" .) | nindent 4 }}
  annotations:
    kubernetes.io/service-account.name: {{ template "authentik-remote-cluster.fullname" . }}
    {{- with .Values.annotations }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
type: kubernetes.io/service-account-token
{{- end }}
