Flux in a Hub $ Spoke Architecture - How to access remote AKS Cluster with Azure RBAC enabled and local_user access disabled

Hering, Martin 0 Reputation points
2025-04-19T23:33:28.5633333+00:00

Hi there,

I'm currently setting up a hub-and-spoke GitOps architecture using the AKS GitOps (Flux) extension. Flux is installed in a central (hub) AKS cluster and is intended to manage application and infrastructure deployments across multiple spoke AKS clusters.

All spoke clusters are configured with Azure RBAC enabled and local_user access disabled, as per our security requirements. This setup prevents the use of static kubeconfigs tied to local cluster admin credentials.

Flux uses a kubeConfig.secretRef to authenticate to the spoke clusters. However, since local_user is disabled and the only supported login mechanism in this scenario is via Azure AD (kubelogin), i am wondering how Flux is able to authenticate to those spoke clusters. We do not want to re-enable local_user as it would introduce a security backdoor by bypassing RBAC.

Is there a Microsoft-supported way to enable Flux to authenticate to remote AKS clusters using Azure AD (i.e., without local_user)?

Can Flux be configured to use a workload identity, managed identity, or service principal to authenticate to remote clusters in this kind of setup?

Is this multi-cluster hub-to-spoke model fully supported under these security constraints, or is there a recommended alternative?

Any help would be highly appreciated

Best regards,

Martin

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,373 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Suwarna S Kale 1,906 Reputation points
    2025-04-20T01:26:05.61+00:00

    Hello Hering, Martin

    Thank you for posting your question in the Microsoft Q&A forum. 

    To enable Flux to authenticate to Azure RBAC-enabled spoke clusters without local_user, Microsoft recommends using Azure Workload Identity a fully supported solution that aligns with zero-trust principles. By configuring Flux with a managed identity federated to Azure AD, the hub cluster can securely access spokes via short-lived tokens, eliminating static credentials. This approach requires annotating Flux’s service account with the managed identity’s client ID and granting it Azure Kubernetes Service Cluster User Role on spoke clusters. Alternatively, Cluster API (CAPZ) or Azure Arc can orchestrate multi-cluster management while maintaining Azure AD authentication. Both methods ensure compliance with security constraints, as they bypass local_user entirely. For production environments, this architecture is Microsoft-validated, provided spoke clusters run Kubernetes v1.22+. 

    If the above answer helped, please do not forget to "Accept Answer" as this may help other community members to refer the info if facing a similar issue. Your contribution to the Microsoft Q&A community is highly appreciated. 


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.