This project demonstrates deploying a Quarkus-based Vert.x application to Google Kubernetes Engine (GKE).
application.properties
file as follows:%prod.host={minikube_ip}
%prod.port={service_port}
quarkus.kubernetes.node-port={port}
...
spotify.client-id={SPOTIFY_APP_CLIENT_ID}
spotify.client-secret={SPOTIFY_APP_CLIENT_SECRET}
minikube start --driver qemu --network socket_vmnet
Minikube virtual machine driver installation: https://minikube.sigs.k8s.io/docs/drivers/qemu/
Configure the local Docker client to use the Docker daemon running inside Minikube:
eval $(minikube docker-env)
Generate Kubernetes Secret to initialize the database server and grant access:
kubectl create secret generic db-credentials --from-literal=username={USERNAME} --from-literal=password={PASSWORD}
kubectl apply -f postgresql_kubernetes.yml
kubectl apply -f mongodb_kubernetes.yml
Build and deploy the application to Minikube with ARM64 platform support:
mvn clean package -Dquarkus.container-image.build=true \
-Dquarkus.jib.platforms=linux/arm64/v8 \
-Dquarkus.kubernetes.deploy=true
Make a request to the deployed service to ensure successful deployment:
http {minikube_ip}:{service_port}/api/person \
Content-Type:application/json \
name="John Doe" \
age:=30
http {minikube_ip}:{service_port}/api/people
Initialize and configure the Google Cloud SDK for authentication:
gcloud auth login
gcloud init
Configure Docker authentication information to interact with Google Artifact Registry for Docker:
gcloud auth configure-docker
Build and push the container image to Google Container Registry using Jib:
mvn clean package -Dquarkus.container-image.build=true \
-Dquarkus.container-image.push=true \
-Dquarkus.jib.platforms=linux/arm64/v8
Create a Kubernetes cluster on Google Kubernetes Engine:
Connect your terminal to the generated Kubernetes cluster on GKE:
gcloud container clusters get-credentials {YOUR_CLUSTER_NAME} --region {YOUR_REGION} --project {YOUR_PROJECT_ID}
Deploy the Quarkus application to the GKE cluster:
mvn clean package -Dquarkus.kubernetes.deploy=true
By following these steps, you can deploy your Vert.x in Quarkus application both locally with Minikube for testing and on Google Kubernetes Engine (GKE) for production. This streamlined deployment process leverages modern tools like Jib and GKE to simplify container image building and Kubernetes orchestration.