Access Your Cluster
Learn how to set the context to work with your cluster by using the kubectl CLI, access the Kubernetes dashboard, and gather basic information about your cluster.
First, login to IBM Cloud using the CLI:
ibmcloud loginWhen asked to choose an account, choose the
IBMaccount. For region, chooseus-east.Set the context for your cluster in your CLI.
a. List the available clusters.
ibmcloud ks clustersNote: If no clusters are shown, make sure you are targeting the right region with
ibmcloud ks region-set us-east.b. Download the configuration file and certificates for your cluster using the
cluster-configcommand.ibmcloud ks cluster-config <your_cluster_name>c. Copy and paste the output export command from the previous step to set the
KUBECONFIGenvironment variable and configure your CLI to runkubectlcommands against your cluster. Example:export KUBECONFIG=/Users...
Note: Every time you log in to the IBM Cloud Kubernetes Service CLI to work with the cluster, you must run these commands to set the path to the cluster's configuration file as a session variable. The Kubernetes CLI uses this variable to find a local configuration file and certificates that are necessary to connect with the cluster in IBM Cloud.
Get basic information about your cluster and its worker nodes. This information can help you manage your cluster and troubleshoot issues.
a. View details of your cluster.
ibmcloud ks cluster-get <your_cluster_name>b. Verify the worker nodes in the cluster.
ibmcloud ks workers <your_cluster_name>Validate access to your cluster.
a. View nodes in the cluster.
kubectl get nodeb. View services, deployments, and pods.
kubectl get svc,deploy,po --all-namespaces
Last updated
Was this helpful?