I use jenkins k8s plugin to deploy slave node,but in the slave container,can not use kubectl,the error is :
User "system:serviceaccount:default:default" cannot list resource "pods" in API group "" in the namespace "default"
Nearly, I done a thing like docker run a slave
, but it's ok, the docker containers can use kubectl, why? thanks!
You need to create a role for cluster-admin for your user:
kubectl create clusterrolebinding permissive-binding --clusterrole=cluster-admin --user=admin --user=kubelet --group=system:serviceaccounts