Deploy nginx-ingress in aks without rbac issue

5/12/2018

I'm new in Kubernetes and was trying to deploy an nginx-ingress in a Aks cluster with Helm.

After the cluster was created with az-cli, tried to deploy nginx-ingress with this command:

helm install stable/nginx-ingress -n nginx-ingress --namespace kube-system --set rbac.create=false

But I had the following error in command line:

Error: release nginx-ingress failed: clusterroles.rbac.authorization.k8s.io "nginx-ingress" is forbidden: attempt to grant extra privileges: [PolicyRule{Resources:["configmaps"], APIGroups:[""], Verbs:["list"]} PolicyRule{Resources:["configmaps"], APIGroups:[""], Verbs:["watch"]} PolicyRule{Resources:["endpoints"], APIGroups:[""], Verbs:["list"]} PolicyRule{Resources:["endpoints"], APIGroups:[""], Verbs:["watch"]} PolicyRule{Resources:["nodes"], APIGroups:[""], Verbs:["list"]} PolicyRule{Resources:["nodes"], APIGroups:[""], Verbs:["watch"]} PolicyRule{Resources:["pods"], APIGroups:[""], Verbs:["list"]} PolicyRule{Resources:["pods"], APIGroups:[""], Verbs:["watch"]} PolicyRule{Resources:["secrets"], APIGroups:[""], Verbs:["list"]} PolicyRule{Resources:["secrets"], APIGroups:[""], Verbs:["watch"]} PolicyRule{Resources:["nodes"], APIGroups:[""], Verbs:["get"]} PolicyRule{Resources:["services"], APIGroups:[""], Verbs:["get"]} PolicyRule{Resources:["services"], APIGroups:[""], Verbs:["list"]} PolicyRule{Resources:["services"], APIGroups:[""], Verbs:["update"]} PolicyRule{Resources:["services"], APIGroups:[""], Verbs:["watch"]} PolicyRule{Resources:["ingresses"], APIGroups:["extensions"], Verbs:["get"]} PolicyRule{Resources:["ingresses"], APIGroups:["extensions"], Verbs:["list"]} PolicyRule{Resources:["ingresses"], APIGroups:["extensions"], Verbs:["watch"]} PolicyRule{Resources:["events"], APIGroups:[""], Verbs:["create"]} PolicyRule{Resources:["events"], APIGroups:[""], Verbs:["patch"]} PolicyRule{Resources:["ingresses/status"], APIGroups:["extensions"], Verbs:["update"]}] user=&{system:serviceaccount:kube-system:default 5ddc4e18-5607-11e8-b434-0a58ac1f0fc5 [system:serviceaccounts system:serviceaccounts:kube-system system:authenticated] map[]} ownerrules=[] ruleResolutionErrors=[]

I'm using the latest az cli, Helm and UbuntuĀ 16.04 (Xenial Xerus).

-- Fabio Henrique Gabriele
azure
docker
kubernetes
kubernetes-helm
nginx

1 Answer

5/14/2018

I just got over this. It looks to me like RBAC may be enabled now on AKS, but only partially? I just created my cluster on 5/11/18.

I took pieces from these two issues...
https://github.com/kubernetes/helm/issues/3985
https://github.com/jenkins-x/jx/issues/485

kubectl create -f ClusterRoles.yaml # (this yaml came from herzogf in the jenkins issue)  
kubectl create serviceaccount tiller --namespace kube-system  
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller  
helm init --upgrade --service-account tiller  
helm repo update  
helm install stable/nginx-ingress --namespace kube-system
-- kduenke
Source: StackOverflow