loading...
Cover image for How to deploy application using Source to Image (S2I) in OpenShift?

How to deploy application using Source to Image (S2I) in OpenShift?

sagarjadhv23 profile image Sagar Jadhav Updated on ・1 min read

OpenShift Essentials (8 Part Series)

1) How to manage Users & Project in Openshift? 2) How to create route in OpenShift? 3 ... 6 3) How to scale an application in OpenShift? 4) How to use Persistent Storage in OpenShift? 5) How to deploy application using Source to Image (S2I) in OpenShift? 6) How to monitor application using probes in OpenShift? 7) How to limit resources using Quotas & Limit Ranges in OpenShift? 8) How to deploy an application using Templates in OpenShift?

Objective

  • Deploy Node JS Application using S2I
  • Update code
  • Rebuild Deployment

Step 1: Set up OpenShift environment

Go to Katacoda.com & click on start scenario

Step 2: Login with developer user

oc login -u <USER_NAME> -p <USER_PASSWORD> <SERVER_URL>

Step 3: Create project my-project

oc new-project my-project

Step 4: Deploy nodejs application using s2i

oc new-app -i nodejs:8 https://github.com/sagar-jadhav/node-hello --name nodejs -l app=demo

Step 5: List pods

oc get pods --watch

Step 6: List all resources

oc get all -l app=demo

Step 7: Create route

oc expose service nodejs

Step 8: List route

oc get route

Step 9: Browse application

From browser, Browse <ROUTE_URL>

Step 10: Clone repository

git clone https://github.com/sagar-jadhav/node-hello

Step 11: Update code

Update "Hello World !!" string in index.js

Step 12: Rebuild deployment

oc start-build nodejs --from-dir=./node-hello/
oc get pods --watch

Step 13: Browse application

From browser, Browse <ROUTE_URL>

OpenShift Essentials (8 Part Series)

1) How to manage Users & Project in Openshift? 2) How to create route in OpenShift? 3 ... 6 3) How to scale an application in OpenShift? 4) How to use Persistent Storage in OpenShift? 5) How to deploy application using Source to Image (S2I) in OpenShift? 6) How to monitor application using probes in OpenShift? 7) How to limit resources using Quotas & Limit Ranges in OpenShift? 8) How to deploy an application using Templates in OpenShift?

Posted on by:

sagarjadhv23 profile

Sagar Jadhav

@sagarjadhv23

Backend Developer (Cloud ☁️) | Cloud Technology Enthusiast (🐳 ☸) Redhat Certified OpenShift Administrator

Discussion

markdown guide