1.2. 遍历


Camel K 中的特征为 operator 提供了一种简单的方法,从 kamel cli 化参数到 kubernetes 对象和配置。Camel K 1.10 中只支持几个特征,在此迁移路径中涵盖这些特征。不需要涵盖以下特征的迁移路径中的配置: camel, platform, deployment, dependencies, deployer, openapi。

以下列表包含其参数的特征,以及 Red Hat build of Apache Camel for Quarkus 中的等效项。

注意

红帽构建的 Apache Camel for Quarkus 的属性必须在 application.properties 中设置。在构建项目时,位于 target/kubernetes/openshift.yml 中的 kubernetes 必须包含属性。

有关属性的更多信息,请参阅 Quarkus OpenShift Extension

表 1.2. builder Trait
遍历参数Quarkus 参数

builder.properties

将属性添加到 application.properties

表 1.3. 容器 Trait
遍历参数Quarkus 参数

container.expose

Service kubernetes 对象会自动创建。

container.image

Quarkus 中没有替换,因为此属性用于无源 Camel K 集成,红帽构建的 Apache Camel for Quarkus 中不被支持。

container.limit-cpu

quarkus.openshift.resources.limits.cpu

container.limit-memory

quarkus.openshift.resources.limits.memory

container.liveness-failure-threshold

quarkus.openshift.liveness-probe.failure-threshold

container.liveness-initial-delay

quarkus.openshift.liveness-probe.initial-delay

container.liveness-period

quarkus.openshift.liveness-probe.period

container.liveness-success-threshold

quarkus.openshift.liveness-probe.success-threshold

container.liveness-timeout

quarkus.openshift.liveness-probe.timeout

container.name

quarkus.openshift.container-name

container.port

quarkus.openshift.ports."<port name>".container-port

container.port-name

在属性名称中设置端口名称。语法为: quarkus.openshift.ports."<port name>".container-porthttps 端口的示例为 quarkus.openshift.ports.https.container-port

container.probes-enabled

将 quarkus maven 依赖项添加到 pom.xml

  <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-smallrye-health</artifactId>
  </dependency>
Copy to Clipboard

它还会将启动探测添加到容器。请注意,延迟、超时和周期值可能会有所不同。

container.readiness-failure-threshold

quarkus.openshift.readiness-probe.failure-threshold

container.readiness-initial-delay

quarkus.openshift.readiness-probe.initial-delay

container.readiness-period

quarkus.openshift.readiness-probe.period

container.readiness-success-threshold

quarkus.openshift.readiness-probe.success-threshold

container.readiness-timeout

quarkus.openshift.readiness-probe.timeout

container.request-cpu

quarkus.openshift.resources.requests.cpu

container.request-memory

quarkus.openshift.resources.requests.memory

container.service-port

quarkus.openshift.ports.<port-name>.host-port

container.service-port-name

在属性名称中设置端口名称。语法为: quarkus.openshift.ports."<port name>".host-porthttps 端口的示例为 quarkus.openshift.ports.https.host-port

另外,请确保将路由端口名称设置为 quarkus.openshift.route.target-port

表 1.4. 环境垃圾
遍历参数Quarkus 参数

environment.vars

quarkus.openshift.env.vars.<key>=<value>

environment.http-proxy

您必须使用以下值设置代理主机: quarkus.kubernetes-client.http-proxyquarkus.kubernetes-client.https-proxyquarkus.kubernetes-client.no-proxy

表 1.5. 错误处理程序垃圾
遍历参数Quarkus 参数

error-handler.ref

您必须在集成路由中手动添加 Error Handler

表 1.6. JVM Trait
遍历参数Quarkus 参数

jvm.debug

quarkus.openshift.remote-debug.enabled

jvm.debug-suspend

quarkus.openshift.remote-debug.suspend

jvm.print-command

没有替换。

jvm.debug-address

quarkus.openshift.remote-debug.address-port

jvm.options

编辑 src/main/docker/Dockerfile.jvm,并更改 JAVA_OPTS 值来设置所需的值。

将 camel 日志级别增加到 debug 的示例:

ENV JAVA_OPTS="$JAVA_OPTS -Dquarkus.log.category.\"org.apache.camel\".level=debug"
Copy to Clipboard

注: Docker 配置依赖于基础镜像,OpenJDK 21 的配置

jvm.classpath

您必须在 maven 项目上设置 classpath,因此依赖项的完整列表将在 target/quarkus-app/ 及之后的版本中打包到 containster 镜像中。

表 1.7. 节点关联性垃圾箱
遍历参数Quarkus 参数
affinity.pod-affinity
affinity.pod-affinity-labels
affinity.pod-anti-affinity
affinity.pod-anti-affinity-labels
affinity.node-affinity-labels
Copy to Clipboard

Quarkus 中没有 关联性 配置。

表 1.8. 所有者 Trait
遍历参数Quarkus 参数

owner.enabled

Quarkus 中没有 所有者 配置。

表 1.9. Quarkus Trait
遍历参数Quarkus 参数

quarkus.package-type

对于原生构建,可使用 -Dnative

表 1.10. Knative Trait
遍历参数Quarkus 参数

knative.enabled

将 maven 依赖项 org.apache.camel.quarkus:camel-quarkus-knative 添加到 pom.xml 中,并设置以下属性:

quarkus.kubernetes.deployment-target=knative
quarkus.container-image.group=<group-name>
quarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000
Copy to Clipboard

quarkus maven 插件需要 quarkus.container-image SetConfiguration 属性来设置生成的 knative.yml 中的镜像 url。

knative.configuration

camel.component.knative.environmentPath

knative.channel-sources

在 knative.json 中配置。

knative.channel-sinks

在 knative.json 中配置。

knative.endpoint-sources

在 knative.json 中配置。

knative.endpoint-sinks

在 knative.json 中配置。

knative.event-sources

在 knative.json 中配置。

knative.event-sinks

在 knative.json 中配置。

knative.filter-source-channels

在 knative.json 中配置。

knative.sink-binding

没有替换,您必须创建 SinkBinding 对象。

knative.auto

没有替换。

knative.namespace-label

您必须将标签 bindings.knative.dev/include=true 手动设置为所需的命名空间。

表 1.11. Knative Service Trait
遍历参数Quarkus 参数

knative-service.enabled

quarkus.kubernetes.deployment-target=knative

knative-service.annotations

quarkus.knative.annotations.<annotation-name>=<value>

knative-service.autoscaling-class

quarkus.knative.revision-auto-scaling.auto-scaler-class

knative-service.autoscaling-metric

quarkus.knative.revision-auto-scaling.metric

knative-service.autoscaling-target

quarkus.knative.revision-auto-scaling.target

knative-service.min-scale

quarkus.knative.min-scale

knative-service.max-scale

quarkus.knative.max-scale

knative-service.rollout-duration

quarkus.knative.annotations."serving.knative.dev/rollout-duration"

knative-service.visibility

quarkus.knative.labels."networking.knative.dev/visibility" 它必须采用引号。

knative-service.auto

红帽构建的 Apache Camel for Quarkus 中不需要此行为。

表 1.12. Prometheus Trait
遍历参数Quarkus 参数

prometheus.enabled

将以下 maven 依赖项添加到 pom.xml

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-micrometer</artifactId>
</dependency>
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-micrometer-registry-prometheus</artifactId>
</dependency>
Copy to Clipboard

注: Camel K 创建一个 PodMonitor 对象,而 Quarkus 会创建一个 ServiceMonitor 对象,它们都正确来配置监控功能。

prometheus.pod-monitor

quarkus.openshift.prometheus.generate-service-monitor

prometheus.pod-monitor-labels

没有可用于设置自定义标签的 quarkus 属性,但您可以在部署前在 target/kubernetes/openshift.yml 中配置 ServiceMonitor 对象中的标签。

表 1.13. PodDisruptionBudget (PDB) Trait
遍历参数Quarkus 参数
pdb.enabled
pdb.min-available
pdb.max-unavailable
Copy to Clipboard

PodDisruptionBudget 对象没有 Quarkus 配置。

表 1.14. Pull Secret Trait
遍历参数Quarkus 参数

pull-secret.secret-name

quarkus.openshift.image-pull-secrets

表 1.15. 路由垃圾
遍历参数Quarkus 参数

route.enabled

quarkus.openshift.route.expose

route.annotations

quarkus.openshift.route.annotations.<key>=<value

route.host

quarkus.openshift.route.host

route.tls-termination

quarkus.openshift.route.tls.termination

route.tls-certificate

quarkus.openshift.route.tls.certificate

route.tls-certificate-secret

没有 quarkus 属性从 secret 读取证书。

route.tls-key

quarkus.openshift.route.tls.key

route.tls-key-secret

没有从 secret 读取密钥的 quarkus 属性。

route.tls-ca-certificate

quarkus.openshift.route.tls.ca-certificate

route.tls-ca-certificate-secret

没有 quarkus 属性从 secret 读取 CA 证书。

route.tls-destination-ca-certificate

quarkus.openshift.route.tls.destination-ca-certificate

route.tls-destination-ca-certificate-secret

没有从 secret 读取目标证书的 quarkus 属性。

route.tls-insecure-edge-termination-policy

quarkus.openshift.route.tls.insecure-edge-termination-policy

表 1.16. 服务 Trait
遍历参数Quarkus 参数

service.enabled

Service kubernetes 对象会自动创建。要禁用它,您必须在部署前从 target/kubernetes/openshift.yml 中删除 kind: Service

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat