Skip to content

rohankanojia-forks/jkube-helidon-se-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploying Helidon Quickstart SE to Kubernetes using Kubernetes Maven Plugin

This project is generated using Helidon Starter. It showcases how seamlessly you can package and deploy your Helidon application to Kubernetes using Kubernetes Maven Plugin

Build and run

With JDK11+

mvn package
java -jar target/helidon-quickstart-se.jar

Exercise the application

$ curl -X GET http://localhost:8080/greet
{"message":"Hello World!"}

$ curl -X GET http://localhost:8080/greet/Joe
{"message":"Hello Joe!"}

Build the Docker Image

$ mvn k8s:build

Start the application with Docker

$ docker run --rm -p 8080:8080 helidon-quickstart-se:latest

Exercise the application as described above

Deploy the application to Kubernetes

Make sure you've logged into some remote Kubernetes cluster from your local machine. You can also use local Kubernetes distributions like minikube and kind for testing purposes.

$ mvn k8s:resource                # Generate kubernetes manifests
$ mvn k8s:apply                   # Apply generated Kubernetes manifests to Kubernetes Cluster
$ kubectl get service helidon-quickstart-se  # Get service info

Deploy the application to Red Hat OpenShift

In order to deploy to Red Hat OpenShift you'd require access to an OpenShift cluster. You can create an account at Red Hat Developer Sandbox which allows trying OpenShift for a limited period.

Once installed, you can deploy your application like this:

$ mvn oc:build oc:resource oc:apply -Popenshift