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

2

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay