I tried multiple syntax including one given below , no luck yet
kubectl exec -u root -it testpod -- bash
Error: unknown shorthand flag: 'u' in -u
See 'kubectl exec --help' for usage.
it is version 1.22
kubectl exec
to mention the user kubectl exec -it testpod -- bash
and then issue su - root
from inside the container