Accessing a Kubernetes cluster with IBM Cloud Kubernetes Service
Connect to your cluster using the Cloud Shell
For this lab, a web shell is provided for you with all the necessary tools. Use this web shell to perform the tasks in this lab.
Using Chrome or Firefox:
- Navigate to IBM Cloud
- Choose the
1835659 - IBMaccount Click the Cloud Shell icon on the top right.
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.
Set the context for your cluster in your CLI. 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.
a. List the available clusters.
ibmcloud ks clustersb. Set an environment variable for your cluster name:
export MYCLUSTER=<your_cluster_name>c. Download the configuration file and certificates for your cluster using the
cluster-configcommand.ibmcloud ks cluster config $MYCLUSTERd. Copy and paste the output command from the previous step to set the
KUBECONFIGenvironment variable and configure your CLI to runkubectlcommands against your cluster.Example: (Do not copy/paste this exact command, but your result from the previous command)
export KUBECONFIG=/Users/user-name/.bluemix/plugins/container-service/clusters/mycluster/kube-config-hou02-mycluster.ymlGet 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 $MYCLUSTERb. Verify the worker nodes in the cluster.
ibmcloud ks workers $MYCLUSTERValidate access to your cluster by viewing the nodes in the cluster.
kubectl get node
Clone the lab repo
From your command line, run:
git clone https://github.com/IBM/istio101 cd istio101/workshopThis is the working directory for the workshop. You will use the example
.yamlfiles that are located in theworkshop/plansdirectory in the following exercises.