Granting a non-root user the access of kubectl in kubernetes Granting a non-root user the access of kubectl in kubernetes kubernetes kubernetes

Granting a non-root user the access of kubectl in kubernetes


kubectl client it's distributed as a binary file so depending on your host you might give exec access to all users by doing chmod +x /usr/local/bin/kubectl

or you can add a custom rule to your /etc/sudoers by using visudo

your_user ALL = NOPASSWD: /usr/local/bin/kubectl

your user will be able to run kubectl like this

sudo kubectl ...