Skip to content

Latest commit

 

History

History
61 lines (39 loc) · 1.05 KB

README.md

File metadata and controls

61 lines (39 loc) · 1.05 KB

Spring Boot Hello World for OpenShift

A simple Spring Boot application with a hello world endpoint, built with Maven and JDK 17, designed for deployment to OpenShift using Source-to-Image (S2I).

Prerequisites

  • JDK 17
  • Maven 3.8+
  • OpenShift CLI (oc)

Building the Application

To build the application locally:

mvn clean package

Running Locally

To run the application locally:

mvn spring-boot:run

The application will be available at http://localhost:8080

Deploying to OpenShift using S2I

  1. Log in to your OpenShift cluster:
oc login <your-openshift-url>
  1. Create a new project or use an existing one:
oc new-project hello-openshift
  1. Create a new application using S2I:
oc new-app --name=hello-openshift java:17~https://your-git-repo-url --context-dir=/ --strategy=source
  1. Expose the service to create a route:
oc expose svc/hello-openshift
  1. Get the route URL:
oc get route hello-openshift

Visit the URL to see your application running on OpenShift.