Lab Environment Setup¶
Every time when you start a new terminal/command window, steps in the section must be performed to setup a new environment.
Run these steps inside the console-in-a-browser environment provided by your instructor, or in a terminal/command window on your local machine.
-
Open a new terminal ort command window.
-
Login to the IBM Cloud. If prompted, enter user name and password.
ibmcloud login
-
List the clusters and locate the cluster corresponding to the userId you used to login to the console-in-a-browser environment. For example, if you are user028, your cluster will be user028-cluster.
Your Lite cluster should show up on the list. The cluster name should be in the format ofibmcloud ks clusters
user###-cluster
, for exampleuser003-cluster
. -
Configure your Kubernetes client using this command. This will also configure your Kubernetes client for future login sessions by adding the command into your .bash_profile.
eval $(ibmcloud ks cluster-config --cluster <your k8s cluster> --export | tee -a ~/.bash_profile)
If the command has a syntax error in your terminal (e.g. windows cmd shell), you may instead run the command
ibmcloud ks cluster-config --cluster <your user>-cluster
. Then, copy the output and execute it in the same terminal. -
You should be able to use kubectl to list kubernetes resources. Try getting the list of pods (there should be none yet)
kubectl get pods No resources found.
-
Login to the registry service
ibmcloud cr login