Welcome to the Linux Foundation Forum!

When I do sudo -i kubectl commands not working

Hi All,
When I do

@master:~$ sudo -i
root@master:~# kubectl get pods
The connection to the server localhost:8080 was refused - did you specify the right host or port?
root@master:~# logout

I get above error, In exams is the kubernetes installed as root ? can I do sudo -i ?

rgds
Balaji

Comments

  • chrispokorni
    chrispokorni Posts: 2,346

    Hi @bkannadassan,

    In lab 3 you will find that the configuration file for the kubectl CLI client sets up cluster admin credentials for the regular (student) user on the master node, and not for the root, hence root cannot run kubectl commands. Also, if you take a closer look at the lab guide, you will see that all kubectl commands are run by the student user, not by root.

    Regards,
    -Chris

Categories

Upcoming Training