Configuring RBAC in AKS
To demonstrate RBAC in AKS, you will create two namespaces and deploy the Azure voting application in each namespace. You will give the group cluster-wide read-only access to pods, and you will give the user the ability to delete pods in only one namespace. Practically, you will need to create the following objects in Kubernetes:
ClusterRole
to give read-only accessClusterRoleBinding
to grant the group access to this roleRole
to give delete permissions in thedelete-access
namespaceRoleBinding
to grant the user access to this role
![A flowchart showing the demo you’ll be building. A user is part of a group. The group has a clusterrole to read pods. The user has an additional namespace scoped role allowing them to delete pods](https://static.packt-cdn.com/products/9781801079945/graphics/image/B17338_08_17.jpg)
Figure 8.17: The group getting read-only access to the whole cluster, and the user getting delete permissions to the delete-access namespace
Let's set up the different roles on your cluster:
- To start our example, you will need to retrieve the ID of the group. The following commands will retrieve the group ID:
az ad group show -g 'handson aks users' \ ...