Setup command line access ΒΆ
This guide shows you how to set up command line tools for accessing Nais clusters
Prerequisites ΒΆ
- naisdevice installed
- nais-cli installed
Install gcloud ΒΆ
Follow Googles instructions on how to install gcloud for your OS
Authenticate using gcloud ΒΆ
gcloud auth login --update-adcThis will open your browser. Follow the instructions to authenticate using the email from your organization.
When successfully authenticated, you will be shown "You are now authenitcated with the gcloud CLI!" in your browser. You can now close the browser window.
You will also need to install a plugin in order to authenticate to the Kubernetes clusters:
gcloud components install gke-gcloud-auth-pluginInstall kubelogin for access to on-prem clusters ΒΆ
Follow Microsoft's instructions on how to install kubelogin for your OS.
Generate kubeconfig file ΒΆ
Use nais-cli to generate the kubeconfig file that grants access to the Nais clusters.
nais kubeconfigA successful run will output how many clusters and where the kubeconfig file is written to.
Install kubectl ΒΆ
Follow the instruction to install kubectl for your OS. The next step of this guide verify that you have access to our clusters, so you can skip the "Verify kubectl configuration" section in the instructions.
Verify access ΒΆ
kubectl --context '<MY-ENV>' get nsIf you are unsure about which environments are available, you can list them with:
kubectl config get-clusters