How to connect to a cluster with kubectl
Once your cluster is created, a .kubeconfig
file is available for download to manage several Kubernetes clusters. You can use this with kubectl
, the Kubernetes command line tool, allowing you to run commands against your Kubernetes clusters. You can use kubectl
from a terminal on your local computer to deploy applications, inspect and manage cluster resources, and view logs.
You may need certain IAM permissions to carry out some actions described on this page. This means:
- you are the Owner of the Scaleway Organization in which the actions will be carried out, or
- you are an IAM user of the Organization, with a policy granting you the necessary permission sets
- You have an account and are logged into the Scaleway console
- You have created a Kubernetes Kapsule cluster
-
Install kubectl on your local computer.
-
Download the
.kubeconfig
files from your Cluster’s overview page: -
Configure access to your cluster. You can do this in one of two ways:
Set the
KUBECONFIG
environment variable:export KUBECONFIG=/$HOME/Downloads/Kubeconfig-ClusterName.yamlOr use
use $HOME/.kube/config file
:mv $HOME/Downloads/Kubeconfig-ClusterName.yaml $HOME/.kube/configEither way, make sure you replace
/$HOME/Downloads/Kubeconfig-ClusterName.yaml
with the correct name and path of your downloaded.kubeconfig
file. -
Run the following command to finish:
kubectl get nodes