Skip to content

Latest commit

 

History

History
159 lines (89 loc) · 4.59 KB

README.md

File metadata and controls

159 lines (89 loc) · 4.59 KB

The Ultimate Kubernetes with RedHat OpenShift workshop series: Webcast 2

This part of the workshop is divided in 5 sections:

  1. Accessing Openshift Cluster for the workshop
  2. Getting started on Openshift Platform on IBM Cloud
  • Overview of Openshift on IBM Cloud
  • Overview of the Openshift console
  • Setting up command line tools to access your cluster
  1. Working with projects in Openshift
  • Create a project on console and delete from CLI
  • Create a project from CLI and delete from console
  1. Deploy an application to Openshift
  • Deploying to Openshift via 'oc' CLI
  • Deployment of code in Github repos
  • Source to image (S2I) deployment
  1. Trigerring an auto build using GitHub webhooks

1. Accessing Openshift Cluster for the workshop

For the purpose of this workshop organizers pre-provisioned for attendees free Red Hat OpenShift Clusters. Thanks to that you can try and learn on how to use them.

The specification of these Red Hat OpenShift clusters is the following:

3 Worker Nodes Each Worker Node has 4 CPU cores with 16GB Ram The abbreviated description: 3 x 4 x 16

Use this URL to claim the clusters: https://os201ws.mybluemix.net/

cluster

Enter the Lab Key given by your instructor, as well as the email address associated with your IBM Cloud account.

After you hit submit, you will be given a cluster for the duration of the workshop.

You should be given the result page showing the successful assignment.

cloud-account

When you sign up / log in to IBM Cloud, from the Dashboard you need to navigate to IBM Org, you can see the option above 'Create Resources tab' beside Docs and Support.

Next, go to the resource list, from the hamburger menu top left to verify your cluster.

resource

Congratulations! You obtained a Red Hat OpenShift 4.3 cluster. Now you are ready for Lab 2.

2. Getting started on Openshift Platform on IBM Cloud

https://cloud.ibm.com/docs/openshift?topic=openshift-deploy_app#app_cli

cloud-account

3. Working with projects in Openshift

Create a project on console

New project from console

Check your access from the cli

ibmcloud oc cluster ls

View project using the CLI

  1. To view a list of projects, run:

$ oc get projects

  1. You can change from the current project to a different project for CLI operations. The specified project is then used in all subsequent operations that manipulate project-scoped content:

oc project <project_name>

Create a project from CLI

oc new-project <project_name> \ --description="<description>" --display-name="<display_name>"

For example:

$ oc new-project hello-openshift \ --description="This is an example project" \ --display-name="Hello OpenShift"

Viewing a project using the web console

  1. Navigate to Home → Projects.

  2. Select a project to view.

On this page, click the Workloads button to see workloads in the project.

Delete a project using the console

  1. Navigate to Home → Projects.

  2. Locate the project that you want to delete from the list of projects.

  3. On the far right side of the project listing, select Delete Project from the Options menu.

  4. When the Delete Project pane opens, enter the name of the project that you want to delete in the field.

  5. Click Delete.

Delete a project from CLI

Run oc delete project <project_name>

4. Deploy an application to Openshift

View deployed app

Deployment of code in Github repos

Deployment successful

Source to image (S2I) deployment

Fork/Clone this example Python repo so that you can edit on the next step https://github.com/sclorg/django-ex

5. Trigerring an auto build using GitHub Webhooks

More on Webhooks : https://docs.openshift.com/container-platform/4.1/builds/triggering-builds-build-hooks.html

More resources:

OpenShift Container Platform 4.3 Documentation

App Mordernization with a NodeJs app

App Mordernization with a Java app