You need to give a developer read-only kubectl access to one namespace.
BeginnerScenarioAKS and Containers
Answer
Situation read → With Azure RBAC enabled, assign a built-in role at namespace scope.
What I'd do →
- Assign the role:
AKS_ID=$(az aks show -g rg -n aks --query id -o tsv) az role assignment create --assignee [email protected] \ --role "Azure Kubernetes Service RBAC Reader" --scope "$AKS_ID/namespaces/shop" az role assignment create --assignee [email protected] \ --role "Azure Kubernetes Service Cluster User Role" --scope "$AKS_ID" - Developer runs
az aks get-credentialsandkubectl get pods -n shop - Confirm
kubectl get pods -n kube-systemis forbidden
Why → The Cluster User role allows downloading kubeconfig; the RBAC Reader role defines what they can see.
Interview tip → Mention both roles; missing Cluster User Role is a common confusion.
More on AKS and Containers
You're asked to build a production AKS cluster. Walk through your key decisions.IntermediateA team wants to deploy a new microservice to AKS that reads a database password. How do you wire secrets?BeginnerYou need to upgrade a production AKS cluster from 1.31 to 1.33. Plan it.AdvancedPods need to scale on Service Bus queue length, not CPU. How?AdvancedYou need to run a GPU workload on an existing AKS cluster. What do you do?IntermediateA noisy application keeps starving other workloads on shared nodes. How do you fix it?Beginner