This example implements a simple Hello World REST service.
- Maven 3.5 or newer
- Java SE 8 or newer
- Docker 17 or newer to build and run docker images
- Kubernetes minikube v0.24 or newer to deploy to Kubernetes (or access to a K8s 1.7.4 or newer cluster)
- Kubectl 1.7.4 or newer to deploy to Kubernetes
Verify prerequisites
java --version
mvn --version
docker --version
minikube version
kubectl version --short
mvn package
java -jar target/quickstart-se.jar
curl -X GET http://localhost:8080/greet
{"message":"Hello World!"}
curl -X GET http://localhost:8080/greet/Joe
{"message":"Hello Joe!"}
curl -X PUT http://localhost:8080/greet/greeting/Hola
{"gretting":"Hola"}
curl -X GET http://localhost:8080/greet/Jose
{"message":"Hola Jose!"}
docker build -t quickstart-se target
docker run --rm -p 8080:8080 quickstart-se:latest
Exercise the application as described above
kubectl cluster-info # Verify which cluster
kubectl get pods # Verify connectivity to cluster
kubectl create -f target/app.yaml # Deply application
kubectl get service quickstart-se # Get service info