Files
cellar/cellar-app
Julien Lengrand-Lambert 0c6393e9e1 Updates deliverable
* Removes dummy greeting provider
* Moves linux scripts to specific folder
* Add scripts to main release delivery
2020-11-16 22:05:29 +01:00
..
2020-11-16 22:05:29 +01:00
2019-12-11 21:30:59 +01:00
2019-12-11 21:30:59 +01:00
2020-11-15 21:40:40 +01:00
2020-07-22 16:55:21 +02:00

Helidon Quickstart MP Example

This example implements a simple Hello World REST service using MicroProfile.

Build and run

With JDK11+

mvn package
java -jar target/cellar-app.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!"}

curl -X PUT -H "Content-Type: application/json" -d '{"greeting" : "Hola"}' http://localhost:8080/greet/greeting

curl -X GET http://localhost:8080/greet/Jose
{"message":"Hola Jose!"}

Try health and metrics

curl -s -X GET http://localhost:8080/health
{"outcome":"UP",...
. . .

# Prometheus Format
curl -s -X GET http://localhost:8080/metrics
# TYPE base:gc_g1_young_generation_count gauge
. . .

# JSON Format
curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics
{"base":...
. . .

Build the Docker Image

docker build -t cellar-app .

Start the application with Docker

docker run --rm -p 8080:8080 cellar-app:latest

Exercise the application as described above

Deploy the application to Kubernetes

kubectl cluster-info                         # Verify which cluster
kubectl get pods                             # Verify connectivity to cluster
kubectl create -f app.yaml               # Deploy application
kubectl get service cellar-app  # Verify deployed service