Skip to main contentIBM Cloud Patterns

Environment Setup

Create an instance of VPC Gen2

Create a Virtual Private Cloud (VPC) on generation 2 compute with a subnet that is located in the zone where you want to create the cluster. Make sure to attach a public gateway to your subnet so that you can access public endpoints from your cluster.

Create a standard VPC Generation 2 compute cluster by using the IBM Cloud console. For more detailed information, please refer here.

Once VPC is created, you need to edit the default security group to allow incoming network traffic from the VPC load balancers. Follow the steps given here for opening security group ports via console. After editing, the Default Security Group of your VPC will show Inbound rules as shown in snapshot below.

Security Group

Create IKS on VPC Infrastructure

Follow the instructions given here and create an IKS instance on VPC. For this pattern, we have created IKS which has worker pool (2vCPU and 4GB RAM) with three worker nodes. Once created, wait for some time (~40 minutes) for the cluster to get ready.

Install the IBM Cloud CLI and plug-ins

It includes the installation of these CLIs and plug-ins:

  1. IBM Cloud CLI (ibmcloud)
  2. IBM Cloud Kubernetes Service plug-in (ibmcloud ks)
  3. IBM Cloud Container Registry plug-in (ibmcloud cr)

Refer to the link to install these.

Install Kubernetes CLI

To work with your cluster, you need to install the Kubernetes CLI. Please refer this link.

Gain access to your cluster

Go to IBM Cloud dashboard and navigate to your Kubernetes cluster. Click on the Access tab as shown below.

Access Your Cluster

Perform the steps given in access tab.

Verify the environment using the following command.

kubectl config current-context

It should return the details of the cluster that you are planning to work with.