Share via

Azure Arc Kubernetes - How do you enable AAD Authentication for a given cluster

Duncan House 90 Reputation points
2024-12-05T14:42:58.2833333+00:00

How do you enable AAD Authentication for a given K8s cluster within Azure Arc. I want to manage the use of Azure RBAC for viewing the azure resource(s), namespaces, workloads, etc.

See image below

User's image

Azure Arc
Azure Arc

A Microsoft cloud service that enables deployment of Azure services across hybrid and multicloud environments.

Azure Kubernetes Service Edge Essentials

Answer accepted by question author

Jeff Pigott 480 Reputation points Microsoft Employee
2024-12-27T16:30:53.6466667+00:00

If you plan to use RBAC you may need to set these commands on the user or group.

If you had this setup before, you will need to delete this first before resetting the clusterrolebinding. As others mentioned the user or group of users need to have this role assigned "Azure Arc Kubernetes Viewer*"***

kubectl delete clusterrolebinding demo-user-binding

For configuring just one user you use the AAD user “name” vs Object ID.

kubectl create clusterrolebinding demo-user-binding --clusterrole cluster-admin --user=`******@yourdomain.com` 

When setting this for a Group, use the Object ID for the group vs. the name of the group.

kubectl create clusterrolebinding demo-user-binding --clusterrole cluster-admin   --group=AAD_GROUP_OBJECT_ID

https://jpigott.com/2023/11/azure-arc-kubernetes-access-by-rbac-roles-for-a-user-or-groups/

https://learn.microsoft.com/en-us/azure/azure-arc/kubernetes/cluster-connect?tabs=azure-cli%2Cagent-version

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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