Logo
OpenScaler

Access Your Cluster from Terminal

To access your cluster from your terminal, follow these steps:

Install kubectl

You will need to install the Kubernetes CLI (kubectl).

Tip

You probably don't need to scroll far, you'll find instructions right at the top for common platforms: Linux, macOS, Windows.

Connect kubectl

With osctl, merge the kubeconfig into ~/.kube/config and select the cluster:

osctl kubernetes kubeconfig save CLUSTER_ID --use

The kubectl context name is the cluster name (for example my-cluster). Switch later with osctl kubernetes kubeconfig use CLUSTER_ID or kubectl config use-context CLUSTER_NAME.

If you already downloaded the file from the console, click Download Kubeconfig on the cluster details page and point kubectl at that file:

Download Kubeconfig

export KUBECONFIG=PATH_TO_YOUR_KUBECONFIG_FILE
$env:KUBECONFIG = "C:\Users\YOUR_USERNAME\Downloads\YOUR_KUBECONFIG_YAML_FILE"
Done!

You may now access your cluster using the kubectl command. Try it out:

kubectl get nodes

Allow Scheduling on Single Node Cluster

Single Node Cluster

If you are using a single node cluster, you need to allow scheduling on the node.

kubectl taint nodes --all node-role.kubernetes.io/control-plane-

Next Steps

Configure Load Balancer

Add a load balancer to your cluster to allow public access to your cluster.