0

The release notes of Quarkus 3 state

This release includes additional features like the quarkus deploy command that enables the deployment of Quarkus applications to platforms like Kubernetes, Knative, and OpenShift without requiring changes to the project dependencies or configuration

But a

quarkus deploy kubernetes        # or minikube

does not the same as

./mvnw clean package -Dquarkus.kubernetes.deploy=true

I used the default REST sample from the generator, added Docker and Kubernetes extension, set the environment, added image-pull-policy=ifNotPresent to application.properties and tried to deploy into a running Minikube on Docker Desktop on Windows 11.

In the 1st case, it would not build anything docker related and start a pod, in the 2nd case everything runs fine.

How should the quarkus command be used?

Alexander Rühl
  • 6,769
  • 9
  • 53
  • 96

3 Answers3

2

Let me give you my magic command trick:

> quarkus build --clean -Dquarkus.container-image.push=true -DskipTests
> quarkus deploy kubernetes
  1. Build the container (I recommend jib) and push it to a registry
  2. Generate the kubernetes descriptor and apply them

I often chain them:

> quarkus build --clean -Dquarkus.container-image.push=true -DskipTests  && quarkus deploy kubernetes

References:

Clement
  • 2,817
  • 1
  • 12
  • 11
  • Thanks. Since Quarkus 3 is pretty fresh, I couldn't find more than that it is now easier with the quarkus command to deploy to kubernetes than before in Quarkus 2, where one still had to edit yml files, what you find as examples on the net. I could use the maven command and thought that there must be an equivalent for Quarkus CLI. – Alexander Rühl Jun 07 '23 at 09:34
1

Note that quarkus build also has the flag --image-build that will also trigger the image build.

iocanel
  • 570
  • 2
  • 2
0

Ok, I solved it myself. But I think it's a bit unintuitive:

./mvnw clean package -Dquarkus.kubernetes.deploy=true

is not identical with

./mvnw clean package
quarkus deploy

after package step, the images have to be build separately:

quarkus image build
Alexander Rühl
  • 6,769
  • 9
  • 53
  • 96