Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
149 lines (98 sloc) 5.23 KB

Deployment on IBM Cloud using IBM Cloud Kubernetes Service

If you want to deploy the Cloud Native Starter on IBM Cloud Kubernetes Service (IKS), the IBM managed Kubernetes offering, then follow these steps. They will create a Kubernetes Lite Cluster with Istio enabled and a namespace in the IBM Container Registry (ICR) where the container images of the microservices will be created, stored, and made available for Kubernetes deployments. By default, deployment is in Dallas, USA (us-south). If you already have a lite cluster in Dallas, these scripts will not work because only one lite cluster is allowed.

A Kubernetes lite cluster itself is free of charge but it can not be created in a IBM Cloud Lite account. In order to create one either a credit card needs to be entered into the IBM Cloud account or you need a promo code which you can sometimes get at conferences where IBM is present. Or contact us, Harald or Niklas, our Twitter links are in the README, and we'll try to get one for you.

Get the code:

$ git clone
$ cd cloud-native-starter


Most important: an IBM Cloud account, you can register for a free account here.

Run this script to check the prerequisites:

$ iks-scripts/

To prepare the deployment on IBM Cloud:

This creates an API key for the scripts.

$ ibmcloud login
$ ibmcloud iam api-key-create cloud-native-starter \
  -d "cloud-native-starter" \
  --file cloud-native-starter.json
$ cat cloud-native-starter.json
$ cp template.local.env local.env 

From the output of cloud-native-starter.json copy the apikey without " " into IBMCLOUD_API_KEY= in file local.env.

The file local.env has preset values for region, cluster name, and image registry namespace in local.env. You can change them of course if you know what you are doing.

Example local.env:


Create IBM Kubernetes Service Environment

This step creates a lite Kubernetes cluster on IBM Cloud.

$ iks-scripts/

Creating a cluster takes some time. Please wait at least 20 minutes before you continue with the next step!

Add Istio

IBM Kubernetes Service has a feature call 'add-ons' that can be installed into an existing cluster. There are several add-ons avaliable, one of them is Istio and another is Istio Extras which contains Kiali, Istios graphical dashboard.

$ iks-scripts/

This command first checks if the cluster created in the previous step is ready and available. If it isn't, the script terminates. Then just wait a few more minutes and try again.

Once complete, the Kiali dashboard can be accessed with this command:

$ kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=kiali -o jsonpath='{.items[0]}') 20001:20001

Then open http://localhost:20001 in your browser, logon with Username: admin, Password: admin

Create Container Registry

When Istio is installed and all Istio pods are started, create a namespace in the IBM Cloud Container Registry:

$ iks-scripts/

The container images we will build next are stored in the Container Registry as<imagename>:<tag> if you didn't change the defaults.

Enable Istio Sidecar Auto Injection

$ kubectl label namespace default istio-injection=enabled

Initial Deployment of Cloud Native Starter

To deploy (or redeploy) run these scripts:

$ iks-scripts/
$ iks-scripts/
$ iks-scripts/
$ iks-scripts/
$ scripts/
$ iks-scripts/

After running all (!) the scripts above, you will get a list of all URLs in the terminal. All these commands use kubectl which requires that the kube environment is set with source iks-scripts/ This is required every time you start a new shell.

Demo Traffic Routing

Run these scripts to deploy version 2 of the web-api and then apply Istio traffic routing to send 80% of the traffic to version 1, 20% to version 2:

$ iks-scripts/
$ scripts/

Create some load and view the traffic distribution in the Kiali console.


Run the following command to delete all cloud-native-starter components from Istio.

$ scripts/

You can also delete single components:

$ scripts/
$ scripts/
$ scripts/
$ scripts/
$ scripts/
$ scripts/
You can’t perform that action at this time.