ekoyudhi / cloud-stack_openshift-kubernetes-ressources

Deploy a simple containerized application on OpenShift using the kubernetes ressources from this repo and a docker image from docker hub.

Home Page:https://dev.to/pmgysel/from-a-docker-image-to-a-deployment-on-openshift-1oj1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deploy simple app on OpenShift

This repo contains all Kubernetes resources necessary to deploy a Docker image from Docker Hub to OpenShift.

Docker image: https://hub.docker.com/r/pmgysel/spring-boot-app

Option 1: Use OpenShift Web Console (GUI)

  • Login to OpenShift
  • In "Developer" view, choose your preferred "Project"
  • Choose "+Add" -> "YAML"
  • Copy-paste the "deployment.yaml" file from this repo, click "Create"
  • Repeat with "service.yaml" and "route.yaml"
  • In "Administrator" view, choose "Networking" -> "Routes"
  • Click on "Location" link -> this is a direct route to your running Docker container
  • Add "/api/ping/" to link -> Now you should see an answer from your app running on OpenShift

Option 2: Use CLI (oc command)

Login to OpenShift (info under "?" -> "Command Line Tools" -> "Copy Login Command")

$ oc login --token=[...] --server=[...]

Choose your preferred project:

$ oc project <YOUR_OS_PROJECT>

Upload all Kubernetes resources:

$ oc apply -f deployment.yaml
$ oc apply -f service.yaml
$ oc apply -f route.yaml

About

Deploy a simple containerized application on OpenShift using the kubernetes ressources from this repo and a docker image from docker hub.

https://dev.to/pmgysel/from-a-docker-image-to-a-deployment-on-openshift-1oj1