Hello ardn,
Yes, it is possible to assign custom Azure RBAC roles at kubernetes namespace level. See the following example:
1.Create a custom role in Azure using the Azure CLI or Azure PowerShell. For example, you can create a custom role called "pod-reader" that allows read access to pods in a namespace:
az role definition create --role-definition '{
"Name": "pod-reader",
"IsCustom": true,
"Description": "Allows read access to pods in a namespace",
"Actions": [
"*/read"
],
"NotActions": [],
"DataActions": [
"Microsoft.ContainerService/managedClusters/namespaces/pods/*"
],
"NotDataActions": []
}'
- Assign the custom role to a user or group. For example, you can assign the "pod-reader" role to a user called "jane":
az role assignment create --role "pod-reader" --assignee "jane" --scope /subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.ContainerService/managedClusters/<cluster-name>/namespaces/<namespace-name>
With above example, user "jane" will have read-only access to pods within the specified namespace in the Kubernetes cluster.
You can read more information about access and identity concepts in Azure on the official documentation:
https://learn.microsoft.com/en-us/azure/aks/concepts-identity
Hope it helps.
Please "Accept as Answer" and upvote if it helped, so that it can help others in the community looking for help on similar topics.
Thank you!