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?
Linux* Ansible* awx* kubernetes

Avatar of undefined
Last Comment
noci
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
abuhaneef
Flag of United States of America image

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.
Avatar of abuhaneef
abuhaneef
Flag of United States of America image

ASKER

Yujin,

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

Thanks


Avatar of simon3270
simon3270
Flag of United Kingdom of Great Britain and Northern Ireland image

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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Linux
Linux

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.

71K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo