I am deploy a pod in kubernetes cluster,but when I check the pod logs in Kubernetes dashboard it shows:
Forbidden (user=kubernetes, verb=get, resource=nodes, subresource=proxy) ( pods/log soa-room-service-df54f5cdb-5htnp)
and I check the log from kubectl it also give the same tips,how to give the permission to user kubenetes? this is the command I am using:
kubectl config set-context --current --namespace=dabai-fat
kubectl logs soa-room-service-df54f5cdb-5htnp
You need to create a clusterrole kubectl create cluserrole rolename --verb=get,proxy --resource=nodes
and a clusterrolebinding kubectl create clusterrolebinding rolebindingname --clusterrole=rolename --user=kubernetes