How to execute command from one pod inside another pod using kubectl exec which are inside a same k8s cluster
问题 I have two pods in a cluster. Lets call them A and B. I've installed kubectl inside pod A and I am trying to run a command inside pod B from pod A using kubectl exec -it podB -- bash . I am getting the following error Error from server (Forbidden): pods "B" is forbidden: User "system:serviceaccount:default:default" cannot create pods/exec in the namespace "default" I've created the following Role and RoleBinding to get access. Role yaml kind: Role apiVersion: rbac.authorization.k8s.io/v1