Step by Step to deploy a Container into Kubernetes, IBM Cloud
- IBM Docker Registry Console
- IBM Cloud Kubernetes
- Design and Implement your App on IBM Cloud
- Scale your App on IBM Cloud
Let's get started by installing the needed CLIs, setting up your first private registry namespace, and pushing your first image.
-
Install the Container Registry plug-in.
ibmcloud plugin install container-registry -r Bluemix
- Log in to your IBM Cloud account.
ibmcloud login -a https://cloud.ibm.com
If you have a federated ID, use ibmcloud login --sso to log in to the IBM Cloud CLI.
- Choose a name for your first namespace, and create that namespace. Use this namespace for the rest of the Quick Start.
ibmcloud cr namespace-add gars
- Log your local Docker daemon into the IBM Cloud Container Registry.
ibmcloud cr login
- Pull the test image from Docker Hub.
docker pull us.icr.io/gars/commerce:lbcluster
- Choose a repository and tag by which you can identify the image. Use the same repository and tag for the rest of this Quick Start.
docker tag us.icr.io/gars/commerce:lbcluster us.icr.io/<namespace>/commerce:lbcluster
- Push the image.
docker push us.icr.io/<namespace>/commerce:lbcluster
- Verify that your image is in your private registry.
ibmcloud cr image-list
Prerequisites Download and install a few CLI tools and the Kubernetes Service plug-in.
curl -sL https://ibm.biz/idt-installer | bash
- Log in to your IBM Cloud account.
ibmcloud login -a https://cloud.ibm.com --sso
- Target the Kubernetes Service region in which you want to work.
ibmcloud ks region-set us-south
- Get the command to set the environment variable and download the Kubernetes configuration files.
ibmcloud ks cluster-config gars_disaster_recovery
- Set the KUBECONFIG environment variable. Copy the output from the previous command and paste it in your terminal. The command output should look similar to the following.
export KUBECONFIG=/Users/igor/.bluemix/plugins/container-service/clusters/gars_disaster_recovery/kube-config-hou02-gars_disaster_recovery.yml
Alternatively, you can directly download your kubeconfig files to manually configure the cluster context.
- Verify that you can connect to your cluster by listing your worker nodes.
kubectl get nodes
- Deploy to a Kubernetes services
kubectl run <service_name> --image=us.icr.io/<namespace>/commerce:lbcluster