Authenticate to the cluster
Prerequisites
Section titled “Prerequisites”Kubectl
Section titled “Kubectl”Kubectl is the Kubernetes command-line tool that allows you to interact with the Kubernetes API.
Install kubectl
Pinniped
Section titled “Pinniped”Pinniped is a Kubernetes authentication provider that allows you to authenticate to a cluster using OIDC.
Install Pinniped
Kubeconfig
Section titled “Kubeconfig”Your organization will provide you with a Kubeconfig file. This file contains the necessary information to authenticate to the cluster.
Two options are available for the discovery of your Kubeconfigs:
- consolidate all the configurations in one file at
$HOME/.kube/config - load the configuration from specific file(s) using the
KUBECONFIGenvironment variableexport KUBECONFIG=<path/to/kubeconfig>export KUBECONFIG=<path/to/kubeconfig1>:<path/to/kubeconfig2>
Check if your Kubeconfig was successfully loaded by running kubectl config view.
Authenticate
Section titled “Authenticate”Then, interacting with the Kubernetes API with kubectl will, the first time, ask you to connect using your SSO credentials. Do so, and then re-execute the command.
$ kubectl auth whoami# Follow instructions and login in to with your SSO account.ATTRIBUTE VALUEUsername oidc:john.doe@example.comGroups [oidc:group1 oidc:group2 system:authenticated]$ kubectl get namespacesNAME STATUS AGEdefault Active 42mk8saas-system Active 42mkube-node-lease Active 42mkube-public Active 42mkube-system Active 42m[...]