Create an IBM Cloud cluster
This guide describes how to create a Kubernetes cluster with IBM Cloud Kubernetes Service.
IBM Cloud Kubernetes Service provides powerful tools and services to help deploy highly available containerized apps in Kubernetes clusters and to automate, isolate, secure, manage, and monitor your workloads across zones or regions.
You can use your existing clusters to install Kubeflow as far as it meets the minimum system requirement.
-
To get started, first go to to create your
IBMid
if you do not have one. Installing the IBM Cloud CLI
Follow the instructions in this Getting started with the IBM Cloud CLI guide to install the IBM Cloud CLI.
-
Refer to this for more info on IBM Cloud Kubernetes Service CLI.
Follow these steps to create a cluster:
Choose the region and the worker node provider for your cluster, and set the environment variables.
export KUBERNERTES_VERSION=1.16
export CLUSTER_ZONE=dal13
export WORKER_NODE_PROVIDER=classic
export CLUSTER_NAME=kubeflow
KUBERNETES_VERSION
specifies the Kubernetes version for the cluster. Runibmcloud ks versions
to see the supported Kubernetes versions. If this environment variable is not set, the cluster will be created with the default version set by IBM Cloud Kubernetes Service. Refer to the Minimum system requirements and choose a Kubernetes version compatible with the Kubeflow release to be deployed.CLUSTER_ZONE
identifies the regions or location where CLUSTER_NAME will be created. Runibmcloud ks locations
to list supported IBM Cloud Kubernetes Service locations. For example, choosedal13
to create CLUSTER_NAME in the Dallas (US) data center.WORKER_NODE_PROVIDER
specifies the kind of IBM Cloud infrastructure on which the Kubernetes worker nodes will be created. The type supports worker nodes with GPUs. There are other worker nodes providers includingvpc-classic
andvpc-gen2
where zone names and worker flavors will be different. Please useibmcloud ks zones --provider ${WORKER_NODE_PROVIDER}
to list zone names if using other providers and set theCLUSTER_ZONE
accordingly.
Notice: If choosing other Kubernetes worker nodes providers than classic
, refer to the IBM Cloud official document for detailed steps.
The worker nodes flavor name varies from zones and providers. Run ibmcloud ks flavors --zone ${CLUSTER_ZONE} --provider ${WORKER_NODE_PROVIDER}
to list available flavors. For example, following are some flavors supported in the dal13
zone with classic
worker node provider.
Now set the environment variable with the flavor you choose.
export WORKER_NODE_FLAVOR=b3c.4x16
Run with the following command to create a cluster:
--name ${CLUSTER_NAME} \
--zone=${CLUSTER_ZONE} \
--version=${KUBERNETES_VERSION} \
--flavor ${WORKER_NODE_FLAVOR} \
--workers=2
Replace the workers
parameter above with the desired number of worker nodes.
Note: If you’re starting in a fresh account with no public and private VLANs, they are created automatically for you when creating a Kubernetes cluster with worker nodes provider classic
for the first time. If you already have VLANs configured in your account, retrieve them via ibmcloud ks vlans --zone ${CLUSTER_ZONE}
and include the public and private VLAN ids (set in the PUBLIC_VLAN_ID
and PRIVATE_VLAN_ID
environment variables) in the command, for example:
Wait until the cluster is deployed and configured. It can take a while for the cluster to be ready. Run with following command to periodically check the state of your cluster. Your cluster is ready when the state is normal
.
ibmcloud ks clusters --provider ${WORKER_NODE_PROVIDER} |grep ${CLUSTER_NAME}|awk '{print "Name:"$1"\tState:"$3}'
To use the created cluster, switch the Kubernetes context to point to the cluster with the command
Make sure all worker nodes are up with the command below