This project is a simple Java/Quarkus REST service. This guide walks you through building and deploying it on Minikube and doing live coding with it through Playpen.
- Minikube 1.33.1 (Although older versions probably work)
- JDK 17 or higher
- docker
minikube start
eval $(minikube docker-env)
kubectl create namespace samples
kubectl config set-context --current --namespace=samples
mvnw clean package -Dquarkus.container-image.build=true
kubectl apply -f minikube.yml
kubectl get services
echo $(minikube ip)
In your browser, you should be able to go to http://`minikube ip`:30507/hello and see the greeting service respond. Check out the code and notice that the GREETING_ENV environment variable is used in creating the greeting message.
Make sure quay.io is reachable as an image repository.
kubectl apply -f https://raw.githubusercontent.com/quarkiverse/quarkus-playpen/main/operator/playpenconfigs-crd.yml
kubectl apply -f https://raw.githubusercontent.com/quarkiverse/quarkus-playpen/main/operator/playpens-crd.yml
kubectl apply -f https://raw.githubusercontent.com/quarkiverse/quarkus-playpen/main/operator/operator.yml
Then create a playpen for your greeting service with the playpen file
kubectl apply -f playpen.yml
You now have enabled Playpen for your service.
Let's take a look at what was created.
kubectl get services
kubectl get deployments
You can see that some additional deployments and services were created. See docs for more info.
mvnw quarkus:dev -Dplaypen.local.connect="greeting -hijack"
Make a change to the project's code. Go to the URL of the greeting service deployed in minikube. The request will be handled by your local quarkus:dev session! End quarkus:dev mode and refresh your browser. You'll see that the old service is now handling requests again.
This example hijacks all requests that are sent to the service. See docs on how it is possible to create a playpen that is specific to your development session.