Link to home
Start Free TrialLog in
Avatar of abuhaneef
abuhaneefFlag for United States of America

asked on

How do I su root in a kubernetes pod?

I have an AWX kubernetes pod.  Once I connect to the pod, how do I elevate to root?
Avatar of Yujin Boby
Yujin Boby
Flag of India image

To connect to a POD terminal, you can use

kubectl exec --stdin --tty POD_NAME_HERE -- /bin/bash

Open in new window


Don't think you can elevate to root.
Avatar of noci
noci

Why would you want to elevate to root... the whole purpose of docker/kubernetes is to shield the host from it's guests. Allowing root inside a container would defeat the whole purpose of containers...

Avatar of abuhaneef

ASKER

Hey Noci.  AWX for ansible installs on a Kubernetes pod.  I need to modify /etc/krb5.conf on the awx pod to have my ansible code talk to Windows servers via kerberos.  Because I am not root, I can't modify config files.
Yujin,

I am familar with that command.  It drops me to "bash-4.4$" with no privileges'.

Thanks


You could update the pod's Deployment so that /etc/krb5.conf is a mounted file, then you can define its contents from the host machine, or from a configmap.

Just remember that modifying a file in a running pod like this won't survive a pod restart.
ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial