Search⌘ K

Accessing the Cluster as a User

Explore how to securely access a Kubernetes cluster by configuring kubectl, setting user credentials, and creating contexts. Understand the difference between authentication and authorization using role-based access control, ensuring users have proper permissions to interact with cluster resources.

Authentication

Since John is not around, we’ll do some role-playing and impersonate him.

Configuring kubectl

We’ll first have to set the cluster using the address and the certificate authority we sent John.

Shell
kubectl config set-cluster jdoe \
--certificate-authority \
/usercode/certs/keys/server-ca.crt \
--server $SERVER

We create a new cluster called jdoe.

Please note that the command we executed created just another config entry that enables us to access all resources ...