# Lab 5 - Deploy the Microservice to Kubernetes

## Step 1: Press "Create toolchain"

[![Create toolchain](https://cloud.ibm.com/devops/graphics/create_toolchain_button.png)](https://cloud.ibm.com/devops/setup/deploy?repository=https%3A%2F%2Fgithub.com%2Fthomassuedbroecker%2Fcloud-native-starter-one-service-workshop-toolchain)

## Step 2: Select the Dallas as region

![Select the Dallas region](https://732079428-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-EUHBXeXqXAYi7i6kY%2F-M-JLLs_vH3ED2m0pW8k%2F-M-FRlufWEuZw0s_ngWI%2Ftoolchain-01.png?generation=1580889372345559\&alt=media)

> *Note:* If you already have an [Continous Delivery](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-getting-started) service instance using a [Lite plan](https://cloud.ibm.com/docs/services/Db2onCloud?topic=Db2onCloud-free_plan) in your IBM Could Account, you must choose the region for your Toolchain where you instantiated your service. *The image below shows the warning.*

![Warning](https://732079428-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-EUHBXeXqXAYi7i6kY%2Fsync%2F174efa32ce1d2ae21185386875bf1a71e453735e.png?generation=1589196203688531\&alt=media)

## Step 3: Configure the location for the cloned GitHub project

I our situation we use **git repos and issue tracking hosted by IBM and built on GitLab Community Edition**.

We will clone the *Cloud Native Starter* project to a repository called **cloud-native-starter-one-service-workshop**-TIMESTAMP.

![Configure the location for the cloned GitHub project](https://732079428-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-EUHBXeXqXAYi7i6kY%2F-M-JLLs_vH3ED2m0pW8k%2F-M-FRluhZqyqv4HAN7AX%2Ftoolchain-02.png?generation=1580889376570077\&alt=media)

*Note:* Depending on your region selection you maybe have to authorize the GitLab hosted in that IBM region.

![Authorize the GitLab hosted in that IBM region](https://732079428-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-EUHBXeXqXAYi7i6kY%2F-M-JLLs_vH3ED2m0pW8k%2F-M-FRluj2fspdvwpT-2j%2Ftoolchain-03.png?generation=1580889373859462\&alt=media)

## Step 4: Create a IBM Cloud API key by pressing "new" and "ok"

Enable the toolchain to create services or set configurations in your IBM Cloud Account, for that it needs an "IBM Cloud API key" depending the region you are working in.

*Note:* You will be informed which name is already in use.

* Create a IBM Cloud API key

![Create a IBM Cloud API key](https://732079428-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-EUHBXeXqXAYi7i6kY%2F-M-JLLs_vH3ED2m0pW8k%2F-M-FUBpqzu_XI1RQ5pHN%2Ftoolchain-04.png?generation=1580889378553659\&alt=media)

* Notification dialog

![Notification dialog](https://732079428-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-EUHBXeXqXAYi7i6kY%2F-M-Ji4lSVZhcWk9NecOs%2F-M-FYfnVRbaoSJv17UHk%2Ftoolchain-05.png?generation=1580895594153067\&alt=media)

## Step 5: Verify the configuration

You see your the relevant information of your created IBM Cloud Container Registry and the IBM Cloud Cluster. Do not change the defaults!

![IBM Cloud Container Registry and the IBM Cloud Cluster information](https://732079428-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-EUHBXeXqXAYi7i6kY%2F-M-JLLs_vH3ED2m0pW8k%2F-M-FcL9xsgNAHs4H74xK%2Ftoolchain-06.png?generation=1580889379752546\&alt=media)

*Note:* If you change the Kubernetes namespace name, you need to be aware of the image pull secret credentials to access a container registry. For more details please visit the following pages.

* [Documentation on IBM Cloud](https://cloud.ibm.com/docs/containers?topic=containers-images)
* [Documentation on Kubernetes](https://kubernetes.io/docs/concepts/containers/images/)

## Step 6: Press "Create"

![Press Create](https://732079428-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-EUHBXeXqXAYi7i6kY%2F-M-FcKjml8PcYSz9BIMT%2F-M-FcL9z-XVFzeKWXRzQ%2Ftoolchain-07.png?generation=1580826978275407\&alt=media)
