Flux Workload Identity

How to configure workload identity for Flux controllers

When running Flux on AWS EKS, Azure AKS and Google Cloud GKE you can leverage Kubernetes Workload Identity to grant Flux controllers access to cloud resources such as container registries, KMS, S3, etc.

Configuring Flux resources

With workload identity, Flux resources must use the provider of the controller identity and leave the ServiceAccount fields unset:

  • For all Flux resource kinds except Kustomization and HelmRelease, set the .spec.provider field to the provider, for example aws, azure, or gcp, and leave .spec.serviceAccountName unset.
  • For remote cluster access with the Kustomization and HelmRelease APIs, set the .data.provider field of the ConfigMap referenced by .spec.kubeConfig.configMapRef, and leave .data.serviceAccountName unset.
  • For SOPS decryption with the Kustomization API, leave the .spec.decryption.serviceAccountName field unset. There is no provider field for SOPS decryption, as the provider is described in the SOPS metadata embedded in the encrypted Secret.

EKS IAM Roles for Service Accounts

To grant Flux access to AWS resources using IRSA during bootstrap add the following patches:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - gotk-components.yaml
  - gotk-sync.yaml
patches:
  - patch: |
      apiVersion: v1
      kind: ServiceAccount
      metadata:
        name: controller
        annotations:
          eks.amazonaws.com/role-arn: <ECR ROLE ARN>      
    target:
      kind: ServiceAccount
      name: "(source-controller|image-reflector-controller)"
  - patch: |
      apiVersion: v1
      kind: ServiceAccount
      metadata:
        name: controller
        annotations:
          eks.amazonaws.com/role-arn: <KMS ROLE ARN>      
    target:
      kind: ServiceAccount
      name: "kustomize-controller"

AKS Workload Identity

To grant Flux access to Azure resources during bootstrap add the following patches:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - gotk-components.yaml
  - gotk-sync.yaml
patches:
  - patch: |
      apiVersion: v1
      kind: ServiceAccount
      metadata:
        name: controller
        annotations:
          azure.workload.identity/client-id: <AZURE CLIENT ID>
          azure.workload.identity/tenant-id: <AZURE TENANT ID>      
    target:
      kind: ServiceAccount
      name: "(source-controller|image-reflector-controller)"
  - patch: |
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: controller
      spec:
        template:
          metadata:
            labels:
              azure.workload.identity/use: "true"      
    target:
      kind: Deployment
      name: "(source-controller|image-reflector-controller)"

GKE Workload Identity

To grant Flux access to Google Cloud resources during bootstrap add the following patches:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - gotk-components.yaml
  - gotk-sync.yaml
patches:
  - patch: |
      apiVersion: v1
      kind: ServiceAccount
      metadata:
        name: controller
        annotations:
          iam.gke.io/gcp-service-account: <GAR ID NAME>      
    target:
      kind: ServiceAccount
      name: "(source-controller|image-reflector-controller)"
  - patch: |
      apiVersion: v1
      kind: ServiceAccount
      metadata:
        name: controller
        annotations:
          iam.gke.io/gcp-service-account: <KMS ID NAME>      
    target:
      kind: ServiceAccount
      name: "kustomize-controller"
Last modified 2026-10-23: [RFC-0014] Overhaul docs (b250cfea)