Ssh to POD on AKS in Azure environment

Hi,

    Recently i have created an AKS cluster on AZURE using the terraform scripts. Also i have installed confluence as one pod in this AKS cluster.

I want to SSH into the confluence pod as root user, but i m unable to find away to login as root user .

I m using the below command as of now:
kubectl exec -it atlassian-confluence-mypod – /bin/bash
I can get into pod in bash mode and when i type "whoami" it gives me as ***“daemon”***. But i want to login as root user by default. Am I missing something?

Thanks,
Swathi S

1 Like

It could be that the pod was designed to prevent root access or elevation, It’s generally best practice to not run containers as ROOT. What are you trying to do that requires root access?

Yeah agree with your point, but i want to install my sql cli on it for some basic function. Since I am not the root user I am unable to install . I have searched google many of the blogs have mentioned to use the previous command which i have mentioned in my original question I should be able to login as root user. But i m unable to do so.

In this case you would generally install the mysql cli in the image itself before it is run or possibly run it as a sidecar service that can talk to mysql on localhost as both pods share the same network namespace.

1 Like