Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy nginx-ingress in aks without rbac issue

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).

like image 512
Fabio Henrique Gabriele Avatar asked May 12 '18 17:05

Fabio Henrique Gabriele


1 Answers

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
like image 104
kduenke Avatar answered Sep 19 '22 23:09

kduenke