Skip to content

Latest commit

 

History

History
139 lines (83 loc) · 5.28 KB

File metadata and controls

139 lines (83 loc) · 5.28 KB

Lab 1 - Install Prerequisites

Access to the IBM Cloud

An IBM Cloud account is needed.

Note: In order to run this workshop an IBM Cloud Lite account is not sufficient. This tutorial may incur costs. Use the Pricing Calculator to generate a cost estimate based on your projected usage.

We will use the OpenShift on IBM Cloud service on IBM Cloud in this hands-on workshop.

Follow the instructions from the first workshop to set up an OpenShift cluster.

Tools

In order to complete the workshop, you need to install Docker Desktop. Docker Desktop is available for Mac and Windows and the Docker Engine can be run natively on Linux.

Several other tools are needed. There are different options to install these tools.


Tools - Option 1: Prebuilt Image with local Code

There is an image on DockerHub with all required tools. In order to use local IDEs and editors to modify code and configuraton files a Docker volume is used. This option works only for Mac and Linux.

Step 1: Run these commands in a terminal

$ git clone https://github.com/nheidloff/openshift-on-ibm-cloud-workshops.git
$ cd openshift-on-ibm-cloud-workshops
$ ROOT_FOLDER=$(pwd)
$ docker run -v $ROOT_FOLDER/:/cloud-native-starter -it --rm nheidloff/openshift-workshop-tools:v1

Step 2: Inside your running Docker image you can access your the local project

root@3f46c41f7303:/usr/local/bin# cd /cloud-native-starter/
root@3f46c41f7303:/cloud-native-starter# ls
root@3f46c41f7303:/cloud-native-starter# ROOT_FOLDER=$(pwd)

Note: With the --rm option in the docker run command the container is deleted once you exit. This is intended.

Tools - Option 2: Prebuilt Image with Code in Container

There is an image on DockerHub with all required tools. This option works for Mac, Linux and Windows. To get started as quickly as possible, use this image.

Step 1: Run this command in a terminal

$ docker run -ti nheidloff/openshift-workshop-tools:v1

Step 2: After the container has been started, run these commands inside your running Docker image to get the lastest version of the workshop:

root@3f46c41f7303:/usr/local/bin# cd /
root@3f46c41f7303:/usr/local/bin# git clone https://github.com/nheidloff/root@3f46c41f7303:/usr/local/bin# openshift-on-ibm-cloud-workshops.git
root@3f46c41f7303:/usr/local/bin# cd openshift-on-ibm-cloud-workshops
root@3f46c41f7303:/usr/local/bin# ROOT_FOLDER=$(pwd)

Note: If you using Windows you also need to download or clone the project to your local workstation for the upcoming Docker and Java lab, because you can't use Docker in the 'openshift-workshop-tools' Docker image.

Tools - Option 3: Install Tools on your Notebook

This approach works only for Mac and Linux (see this article for more).

Step 1: Install the following tools:

Step 2: Get the code:

$ git clone https://github.com/nheidloff/openshift-on-ibm-cloud-workshops.git
$ cd openshift-on-ibm-cloud-workshops
$ ROOT_FOLDER=$(pwd)

Verify Access to OpenShift on the IBM Cloud

Step 1: After you've created a new cluster, open the OpenShift console.

  1. Logon to the IBM Cloud web console

  2. Select OpenShift in the menu

Select Open Shift in the menu

  1. Chose Clusters and click on your OpenShift cluster

Chose Clusters and click on your OpenShift cluster

  1. Open the OpenShift web console

Open the OpenShift web console

Step 2: Get our access token for the 'oc' CLI.

  1. From the dropdown menu in the upper right of the page, click 'Copy Login Command'. Paste the copied command into your terminal.

Key

  1. Verify 'oc' CLI
$ oc login https://c1-e.us-east.containers.cloud.ibm.com:23967 --token=xxxxxx'
$ oc get istag
  1. Verify 'kubectl' CLI
$ kubectl get pods

Note: Back to lab 4 '1. Build and Save the container image' in 'Step 1'


Continue with Lab 2 - Running the Java Microservice locally