Resoving error “unable to upgrade connection: Forbidden” executing kubectl exec¶
The first time you try to access a container may fail with the following error:
$ kubectl -n testadmin exec -it server-jxqp8 "df -h"
error: unable to upgrade connection: Forbidden (user=client, verb=create, resource=nodes, subresource=proxy)
This is solved adding the following rolebinding (as user admin):
$ kubectl create clusterrolebinding apiserver-kubelet-admin --user=client --clusterrole=system:kubelet-api-admin