简体   繁体   English

我想使用 helm chart 在 kube.netes 上部署我的 quakrus 应用程序

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

So, I created a basic quarkus app.所以,我创建了一个基本的 quarkus 应用程序。 Then I added the kube.netes and helm extension.然后我添加了 kube.netes 和 helm 扩展。 I did./mvnw clean package command.我做了./mvnw clean package 命令。 In the target directory, a helm directory was added with the chat.yaml, values.yaml and the templates.在目标目录中,添加了一个 helm 目录,其中包含 chat.yaml、values.yaml 和模板。 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.现在在 deployment.yaml 中有一个图像部分:myimage。 What is the image that should be there.应该在那里的图像是什么。 Also I followed the instructions of the documentation of quarkus with helm, but nothing happens.我也按照 quarkus 文档的说明进行操作,但没有任何反应。

I tried to install with helm by doing: helm install helm-example./target/helm/kube.netes/.我尝试通过以下方式安装 helm: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. Quarkus Kube.netes 和 Quarkus Helm 是生成 Kube.netes 资源的扩展。 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.默认情况下,Quarkus Kube.netes 扩展将使用基于您的系统属性/应用程序元数据的容器映像,这在安装生成的 Kube.netes 资源时可能不正确。

Luckily, Quarkus provides a few extensions to generate container images (see documentation ).幸运的是,Quarkus 提供了一些扩展来生成容器镜像(参见文档)。

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.例如,如果您决定使用Quarkus Container Image Jib ,现在 Quarkus 也会在打包您的应用程序时在本地构建容器镜像。 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).尽管如此,在安装 Kube.netes 资源时该图像仍然不可用,因为该图像位于您的本地计算机中,而远程 Kube.netes 实例无法访问它,因此您需要将此生成的图像推送到容器注册表中(例如 docker hub 或 quay.io)。 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.再次构建您的应用程序后,现在 Quarkus 将生成 Kube.netes 资源和容器镜像,它们将在容器注册表中可用。

Additionally, if you want to install the generated chart by the Quarkus Helm extension, you can overwrite the container image before installing it:此外,如果你想安装 Quarkus Helm 扩展生成的图表,你可以在安装之前覆盖容器镜像:

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

I hope it helps!我希望它有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何部署预打包的 Quarkus Azure Functions 应用程序 - How can I deploy a prepackaged Quarkus Azure Functions app 如何在 GCP 上部署 Quarkus? - How I can deploy Quarkus on GCP? 如何从 Quarkus 的 application.properties 及其 helm extension 生成 kubernetes configmap? - How to generate kubernetes configmap from the Quarkus `application.properties` with its `helm extension`? 我的 Camel route 应用程序检测到其他应用程序发布的 ampq 消息(?),但是无法处理,出现“没有可用的类型转换器”错误。 我该如何解决? - My Camel route app detects other app's published ampq message(?), but, fails to handle, with "no type converter available" error. How can I resolve? Quarkus - 在 Raspberry PI 中部署 - Quarkus - Deploy in Raspberry PI 在 Kubernetes 上启动 Quarkus 时出现 NumberFormatException - NumberFormatException when starting Quarkus on Kubernetes 如何记录由 Quarkus 应用程序创建的 SQL 语句? - How can I log SQL statements in created by my Quarkus application? 如何在 Quarkus 中为我的 RESTEasy 资源设置基本路径? - How can I set the base path for my RESTEasy resources in Quarkus? kubernetes 中的 smallrye 指标导致就绪和活跃度失败 - Readiness and liveness failed with smallrye metrics in kubernetes quarkus热部署而不保存文件 - quarkus hot deploy without saving file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM