I created a Jenkins persistent app using this template here. Now when a pod gets created and I want to access pod as a root user. But when I do oc rsh jenkins-mypod
, it opens the pod as a default
user. I want to open the pod as the root
user. How can I do that?. I created this app under the developer
account.
Try using "kubectl ssh" plugin from here: https://github.com/jordanwilson230/kubectl-plugins
You can use a third-party tool kubectl-exec-user to achieve this. It does not require allowing sudo
or any other privilege escalation mechanism in the container.
There is currently no built-in solution.
This is an opened issue in kubernetes https://github.com/kubernetes/kubernetes/issues/30656 so I don't think it's possible in openshift either.