简体   繁体   中英

I want to deploy my quakrus app on kubernetes using helm chart

So, I created a basic quarkus app. Then I added the kube.netes and helm extension. I did./mvnw clean package command. In the target directory, a helm directory was added with the chat.yaml, values.yaml and the templates. All these are based on the app I deployed firstly: meaning with a specific name. Now in the deployment.yaml there is a section of image: myimage. What is the image that should be there. Also I followed the instructions of the documentation of quarkus with helm, but nothing happens.

I tried to install with helm by doing: helm install helm-example./target/helm/kube.netes/. What should I do in order to see my app in the browser?

Quarkus Kube.netes and Quarkus Helm are extensions to generate Kube.netes resources. The component that you might be missing is to also build/generate the container image of your application (the binaries).

By default, the Quarkus Kube.netes extension will use a container image based on your system properties/application metadata, which might not be correct when installing the generated Kube.netes resources.

Luckily, Quarkus provides a few extensions to generate container images (see documentation ).

For example, if you decide to use the Quarkus Container Image Jib , now Quarkus will also build the container image locally when packaging your application. Still, the image won't be available when installing the Kube.netes resources because the image is in your local machine and this is not accessible by the remote Kube.netes instance, so you need to push this generated image into a container registry (docker hub or quay.io for example). You can configure these properties by adding:

# To specify the container registry
quarkus.container-image.registry=quay.io
# To instruct Quarkus to also push the generated image into the above registry
quarkus.container-image.push=true

After building again your application, now Quarkus will generate both the Kube.netes resources and the container image which will be available in a container registry.

Additionally, if you want to install the generated chart by the Quarkus Helm extension, you can overwrite the container image before installing it:

helm install helm-example ./target/helm/kubernetes/<chart name> --set app.image=<full container image>

I hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM