Project presentation for JConf Peru 2025
This is a basic Quarkus Maven project configured to explore Kubernetes concepts with easy deployment to local clusters (like k3s) and external clusters (like Red Hat OpenShift Sandbox).
- ✅ RESTful API with two endpoints
- ✅ Health checks (liveness, readiness, startup)
- ✅ Automatic Kubernetes manifest generation
- ✅ Container image build with JIB
- ✅ Ready for k3s and OpenShift deployment
- ✅ JSON support with Jackson
- Java 17+
- Maven 3.9+
- Docker (for container image builds)
- kubectl (for Kubernetes deployments)
- k3s, minikube, or access to Red Hat OpenShift Sandbox
Run the application in dev mode with live coding enabled:
./mvnw quarkus:devThe application will be available at:
- Main app: http://localhost:8080
- Dev UI: http://localhost:8080/q/dev/
- Health: http://localhost:8080/health
# Simple greeting
curl http://localhost:8080/hello
# Application info
curl http://localhost:8080/hello/info
# Health check
curl http://localhost:8080/health./mvnw clean package -Dquarkus.container-image.build=trueThis creates a container image: jconfperu/quarkus-k8s-demo:1.0.0-SNAPSHOT
./mvnw clean package \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.push=true \
-Dquarkus.container-image.registry=docker.io \
-Dquarkus.container-image.username=<your-username> \
-Dquarkus.container-image.password=<your-password>Kubernetes manifests are automatically generated during the build in target/kubernetes/:
./mvnw clean packageThe generated files include:
target/kubernetes/kubernetes.yml- Complete Kubernetes deploymenttarget/kubernetes/kubernetes.json- JSON format
- Install k3s (if not already installed):
curl -sfL https://get.k3s.io | sh -- Build and load the image:
# Build the container image
./mvnw clean package -Dquarkus.container-image.build=true
# Import to k3s (if using local registry)
docker save jconfperu/quarkus-k8s-demo:1.0.0-SNAPSHOT | sudo k3s ctr images import -- Deploy to k3s:
sudo kubectl apply -f target/kubernetes/kubernetes.yml- Check deployment status:
sudo kubectl get pods
sudo kubectl get svc quarkus-k8s-demo- Access the application:
# Get the service URL
sudo kubectl get svc quarkus-k8s-demo
# Port forward to access locally
sudo kubectl port-forward svc/quarkus-k8s-demo 8080:80- Test the application:
curl http://localhost:8080/hello
curl http://localhost:8080/hello/info- Login to OpenShift:
oc login --token=<your-token> --server=<your-server>- Build and deploy with OpenShift profile:
./mvnw clean package -Dquarkus.profile=openshift \
-Dquarkus.container-image.build=true \
-Dquarkus.kubernetes.deploy=trueThis will:
- Build the container image
- Push to OpenShift's internal registry
- Deploy the application
- Create a Route for external access
- Get the application URL:
oc get route quarkus-k8s-demo- Access the application:
curl https://<route-url>/hello
curl https://<route-url>/hello/info./mvnw test./mvnw package
java -jar target/quarkus-app/quarkus-run.jar./mvnw package -Dquarkus.package.jar.type=uber-jar
java -jar target/quarkus-k8s-demo-1.0.0-SNAPSHOT-runner.jar./mvnw package -Dnative -Dquarkus.native.container-build=true
./target/quarkus-k8s-demo-1.0.0-SNAPSHOT-runnerKey configuration properties in src/main/resources/application.properties:
quarkus.kubernetes.replicas=2- Number of replicasquarkus.kubernetes.service-type=LoadBalancer- Service typequarkus.container-image.group=jconfperu- Container image groupquarkus.container-image.build=false- Auto-build images
| Endpoint | Method | Description |
|---|---|---|
/hello |
GET | Returns a greeting message |
/hello/info |
GET | Returns application information (JSON) |
/health |
GET | SmallRye health check endpoint |
/health/live |
GET | Liveness probe |
/health/ready |
GET | Readiness probe |
/health/started |
GET | Startup probe |
- Quarkus 3.17.5 - Supersonic Subatomic Java Framework
- Java 17 - LTS version
- RESTEasy Reactive - JAX-RS implementation
- Jackson - JSON processing
- SmallRye Health - Health check implementation
- Quarkus Kubernetes - Automatic manifest generation
- JIB - Container image building without Docker
- Quarkus
- Quarkus Kubernetes Guide
- Quarkus Container Images Guide
- k3s Documentation
- Red Hat OpenShift Sandbox
This is a demo project for JConf Peru 2025. Feel free to fork and experiment!
This project is open source and available under standard terms.