kubernetes pods logs shows forbidden

1/26/2020

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
-- Dolphin
kubernetes

1 Answer

1/26/2020

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

-- Arghya Sadhu
Source: StackOverflow