DEV Community

Cover image for How to deploy an application using Templates in OpenShift?
Sagar Jadhav
Sagar Jadhav

Posted on • Originally published at developersthought.in

How to deploy an application using Templates in OpenShift?

Objective

  • Create project my-project
  • Deploy PHP Application using Templates

Step 1: Set up Openshift environment

Go to Katacoda.com & click on start scenario

Step 2: Create project my-project

oc new-project my-project
Enter fullscreen mode Exit fullscreen mode

Step 3: Update permissions

setenforce 0
Enter fullscreen mode Exit fullscreen mode

Step 4: List templates

oc get templates -n openshift
Enter fullscreen mode Exit fullscreen mode

Step 5: Describe php template

oc describe template cakephp-mysql-persistent -n openshift
Enter fullscreen mode Exit fullscreen mode

Step 6: Deploy php application

oc new-app cakephp-mysql-persistent --name cakephp -l app=demo
Enter fullscreen mode Exit fullscreen mode
oc get pods --watch
Enter fullscreen mode Exit fullscreen mode

Step 7: List route

oc get route
Enter fullscreen mode Exit fullscreen mode

Step 8: Access application

From browser, Browse http://<ROUTE_URL>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)