Chapter 6. Camel K developer reference
This chapter provides reference information about advanced features and core capabilities that you can configure on the command line at runtime. Red Hat Integration - Camel K provides feature traits to configure Camel K for specific features and technologies. Camel K also provides platform traits to configure internal Camel K core capabilities.
The Red Hat Integration - Camel K Technology Preview includes the OpenShift
and Knative
profiles. The Kubernetes
profile has community-only support.
This Technology Preview includes Java, XML, and YAML DSL for integrations. Other languages such as Groovy, JavaScript, and Kotlin have community-only support.
This chapter includes the following sections:
Camel K feature traits
- Section 6.2.1, “3scale Trait”
- Section 6.2.2, “Affinity Trait”
- Section 6.2.3, “Cron Trait”
- Section 6.2.4, “Gc Trait”
- Section 6.2.5, “Istio Trait”
- Section 6.2.6, “Jolokia Trait”
- Section 6.2.7, “Knative Trait”
- Section 6.2.8, “Knative Service Trait”
- Section 6.2.9, “Master Trait”
- Section 6.2.10, “Prometheus Trait”
- Section 6.2.11, “Quarkus Trait”
- Section 6.2.12, “Route Trait”
- Section 6.2.13, “Service Trait”
Camel K core platform traits
- Section 6.3.1, “Builder Trait”
- Section 6.3.3, “Camel Trait”
- Section 6.3.2, “Container Trait”
- Section 6.3.4, “Dependencies Trait”
- Section 6.3.5, “Deployer Trait”
- Section 6.3.6, “Deployment Trait”
- Section 6.3.7, “Environment Trait”
- Section 6.3.8, “Jvm Trait”
- Section 6.3.9, “OpenAPI”
- Section 6.3.10, “Owner Trait”
- Section 6.3.11, “Platform Trait”
6.1. Camel K traits and profiles
Camel K traits are advanced features and core capabilities that you can configure on the command line to customize Camel K integrations. For example, this includes feature traits that configure interactions with technologies such as 3scale API Management, Quarkus, Knative, and Prometheus. Camel K also provides internal platform traits that configure important core platform capabilities such as Camel support, containers, dependency resolution, and JVM support.
Camel K profiles define the target cloud platforms on which Camel K integrations run. The Camel K Technology Preview supports the OpenShift
and Knative
profiles.
When you run an integration on OpenShift, Camel K uses the Knative
profile when OpenShift Serverless is installed on the cluster. Camel K uses the OpenShift
profile when OpenShift Serverless is not installed.
You can also specify the profile at runtime using the kamel run --profile
option.
Camel K provides useful defaults for all traits, taking into account the target profile on which the integration runs. However, advanced users can configure Camel K traits for custom behavior. Some traits only apply to specific profiles such as OpenShift
or Knative
. For more details, see the available profiles in each trait description.
Camel K trait configuration
Each Camel trait has a unique ID that you can use to configure the trait on the command line. For example, the following command disables creating an OpenShift Service for an integration:
$ kamel run --trait service.enabled=false my-integration.yaml
You can also use the -t
option to specify traits.
Camel K trait properties
You can use the enabled
property to enable or disable each trait. All traits have their own internal logic to determine if they need to be enabled when the user does not activate them explicitly.
Disabling a platform trait may compromise the platform functionality.
Some traits have an auto
property, which you can use to enable or disable automatic configuration of the trait based on the environment. For example, this includes traits such as 3scale, Cron, and Knative. This automatic configuration can enable or disable the trait when the enabled
property is not explicitly set, and can change the trait configuration.
Most traits have additional properties that you can configure on the command line. For more details, see the descriptions for each trait in the sections that follow.
6.2. Camel K feature traits
6.2.1. 3scale Trait
The 3scale trait can be used to automatically create annotations that allow 3scale to discover the generated service and make it available for API management.
The 3scale trait is disabled by default.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
6.2.1.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait 3scale.[key]=[value] --trait 3scale.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
3scale.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
3scale.auto | bool | Enables automatic configuration of the trait. |
3scale.scheme | string |
The scheme to use to contact the service (default |
3scale.path | string |
The path where the API is published (default |
3scale.port | int |
The port where the service is exposed (default |
3scale.description-path | string |
The path where the Open-API specification is published (default |
6.2.2. Affinity Trait
Allows to constrain which nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node, or with inter-pod affinity and anti-affinity, based on labels on pods that are already running on the nodes.
It’s disabled by default.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
6.2.2.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait affinity.[key]=[value] --trait affinity.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
affinity.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
affinity.pod-affinity | bool | Always co-locates multiple replicas of the integration in the same node (default false). |
affinity.pod-anti-affinity | bool | Never co-locates multiple replicas of the integration in the same node (default false). |
affinity.node-affinity-labels | string | Defines a set of nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node. |
affinity.pod-affinity-labels | string | Defines a set of pods (namely those matching the label selector, relative to the given namespace) that the integration pod(s) should be co-located with. |
affinity.pod-anti-affinity-labels | string | Defines a set of pods (namely those matching the label selector, relative to the given namespace) that the integration pod(s) should not be co-located with. |
6.2.2.2. Examples
To schedule the integration pod(s) on a specific node using the built-in node label
kubernetes.io/hostname
:$ kamel run -t affinity.node-affinity-labels="kubernetes.io/hostname in(node-66-50.hosted.k8s.tld)" ...
To schedule a single integration pod per node (using the
Exists
operator):$ kamel run -t affinity.pod-anti-affinity-labels="camel.apache.org/integration" ...
To co-locate the integration pod(s) with other integration pod(s):
$ kamel run -t affinity.pod-affinity-labels="camel.apache.org/integration in(it1, it2)" ...
The labels options follow the requirements from Label selectors. They can be multi-valuated, then the requirements list is ANDed, e.g., to schedule a single integration pod per node AND not co-located with the Camel K operator pod(s):
$ kamel run -t affinity.pod-anti-affinity-labels="camel.apache.org/integration" -t affinity.pod-anti-affinity-labels="camel.apache.org/component=operator" ...
More information can be found in the official Kubernetes documentation about Assigning Pods to Nodes.
6.2.3. Cron Trait
The Cron trait can be used to customize the behaviour of periodic timer/cron based integrations.
While normally an integration requires a pod to be always up and running, some periodic tasks, such as batch jobs, require to be activated at specific hours of the day or with a periodic delay of minutes. For such tasks, the cron trait can materialize the integration as a Kubernetes CronJob instead of a standard deployment, in order to save resources when the integration does not need to be executed.
Integrations that start from the following components are evaluated by the cron trait: timer
, cron
, quartz
.
The rules for using a Kubernetes CronJob are the following:
-
timer
: when periods can be written as cron expressions. E.g.timer:tick?period=60000
. -
cron
,quartz
: when the cron expression does not contain seconds (or the "seconds" part is set to 0). E.g.cron:tab?schedule=0/2+*+*+*+?
orquartz:trigger?cron=0+0/2+*+*+*+?
.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
6.2.3.1. Examples
The following route is materialized into a Kubernetes CronJob by the cron
trait:
CronJob.java
import org.apache.camel.builder.RouteBuilder public class CronJob extends RouteBuilder { @Override public void configure() throws Exception { // Setting the period e.g. to '1000' restores the default behavior from("timer:java?period=60000") .setBody() .simple("Hello World from Camel K in a CronJob") .to("log:info?showAll=false"); } }
6.2.3.2. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait cron.[key]=[value] --trait cron.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
cron.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
cron.schedule | string | The CronJob schedule for the whole integration. If multiple routes are declared, they must have the same schedule for this mechanism to work correctly. |
cron.components | string |
A comma separated list of the Camel components that need to be customized in order for them to work when the schedule is triggered externally by Kubernetes. A specific customizer is activated for each specified component. E.g. for the
Supported components are currently: |
cron.fallback | bool |
Use the default Camel implementation of the |
cron.concurrency-policy | string | Specifies how to treat concurrent executions of a Job. Valid values are: - "Allow": allows CronJobs to run concurrently; - "Forbid" (default): forbids concurrent runs, skipping next run if previous run hasn’t finished yet; - "Replace": cancels currently running job and replaces it with a new one |
cron.auto | bool |
Automatically deploy the integration as CronJob when all routes are either starting from a periodic consumer (only
It’s required that all periodic consumers have the same period and it can be expressed as cron schedule (e.g. |
6.2.4. Gc Trait
The GC Trait garbage-collects all resources that are no longer necessary upon integration updates.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
6.2.4.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait gc.[key]=[value] --trait gc.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
gc.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
gc.discovery-cache | string |
Discovery client cache to be used, either |
6.2.5. Istio Trait
The Istio trait allows to configure properties related to the Istio service mesh, such as sidecar injection and outbound IP ranges.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
6.2.5.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait istio.[key]=[value] --trait istio.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
istio.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
istio.allow | string |
Configures a (comma-separated) list of CIDR subnets that should not be intercepted by the Istio proxy ( |
istio.inject | bool |
Forces the value for labels |
6.2.6. Jolokia Trait
The Jolokia trait activates and configures the Jolokia Java agent.
See https://jolokia.org/reference/html/agents.html
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
6.2.6.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait jolokia.[key]=[value] --trait jolokia.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
jolokia.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
jolokia.ca-cert | string |
The PEM encoded CA certification file path, used to verify client certificates, applicable when |
jolokia.client-principal | []string |
The principal(s) which must be given in a client certificate to allow access to the Jolokia endpoint, applicable when |
jolokia.discovery-enabled | bool |
Listen for multicast requests (default |
jolokia.extended-client-check | bool |
Mandate the client certificate contains a client flag in the extended key usage section, applicable when |
jolokia.host | string |
The Host address to which the Jolokia agent should bind to. If |
jolokia.password | string |
The password used for authentication, applicable when the |
jolokia.port | int |
The Jolokia endpoint port (default |
jolokia.protocol | string |
The protocol to use, either |
jolokia.user | string | The user to be used for authentication |
jolokia.use-ssl-client-authentication | bool |
Whether client certificates should be used for authentication (default |
jolokia.options | string |
A comma-separated list of additional Jolokia options as defined in JVM agent configuration options, e.g.: |
6.2.7. Knative Trait
The Knative trait automatically discovers addresses of Knative resources and inject them into the running integration.
The full Knative configuration is injected in the CAMEL_KNATIVE_CONFIGURATION in JSON format. The Camel Knative component will then use the full configuration to configure the routes.
The trait is enabled by default when the Knative profile is active.
This trait is available in the following profiles: Knative.
6.2.7.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait knative.[key]=[value] --trait knative.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
knative.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
knative.configuration | string | Can be used to inject a Knative complete configuration in JSON format. |
knative.channel-sources | string | Comma-separated list of channels used as source of integration routes. Can contain simple channel names or full Camel URIs. |
knative.channel-sinks | string | Comma-separated list of channels used as destination of integration routes. Can contain simple channel names or full Camel URIs. |
knative.endpoint-sources | string | Comma-separated list of channels used as source of integration routes. |
knative.endpoint-sinks | string | Comma-separated list of endpoints used as destination of integration routes. Can contain simple endpoint names or full Camel URIs. |
knative.event-sources | string | Comma-separated list of event types that the integration will be subscribed to. Can contain simple event types or full Camel URIs (to use a specific broker different from "default"). |
knative.event-sinks | string | Comma-separated list of event types that the integration will produce. Can contain simple event types or full Camel URIs (to use a specific broker). |
knative.filter-source-channels | bool | Enables filtering on events based on the header "ce-knativehistory". Since this is an experimental header that can be removed in a future version of Knative, filtering is enabled only when the integration is listening from more than 1 channel. |
knative.auto | bool | Enable automatic discovery of all trait properties. |
6.2.8. Knative Service Trait
The Knative Service trait allows to configure options when running the integration as Knative service instead of a standard Kubernetes Deployment.
Running integrations as Knative Services adds auto-scaling (and scaling-to-zero) features, but those features are only meaningful when the routes use a HTTP endpoint consumer.
This trait is available in the following profiles: Knative.
6.2.8.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait knative-service.[key]=[value] --trait knative-service.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
knative-service.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
knative-service.autoscaling-class | string |
Configures the Knative autoscaling class property (e.g. to set Refer to the Knative documentation for more information. |
knative-service.autoscaling-metric | string |
Configures the Knative autoscaling metric property (e.g. to set Refer to the Knative documentation for more information. |
knative-service.autoscaling-target | int | Sets the allowed concurrency level or CPU percentage (depending on the autoscaling metric) for each Pod. Refer to the Knative documentation for more information. |
knative-service.min-scale | int | The minimum number of Pods that should be running at any time for the integration. It’s zero by default, meaning that the integration is scaled down to zero when not used for a configured amount of time. Refer to the Knative documentation for more information. |
knative-service.max-scale | int | An upper bound for the number of Pods that can be running in parallel for the integration. Knative has its own cap value that depends on the installation. Refer to the Knative documentation for more information. |
knative-service.auto | bool | Automatically deploy the integration as Knative service when all conditions hold:
|
6.2.9. Master Trait
The Master trait allows to configure the integration to automatically leverage Kubernetes resources for doing leader election and starting master routes only on certain instances.
It’s activated automatically when using the master endpoint in a route, e.g. from("master:lockname:telegram:bots")…
.
this trait adds special permissions to the integration service account in order to read/write configmaps and read pods. It’s recommended to use a different service account than "default" when running the integration.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
6.2.9.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait master.[key]=[value] --trait master.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
master.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
master.auto | bool | Enables automatic configuration of the trait. |
master.include-delegate-dependencies | bool |
When this flag is active, the operator analyzes the source code to add dependencies required by delegate endpoints. E.g. when using |
master.configmap | string | Name of the configmap that will be used to store the lock. Defaults to "<integration-name>-lock". |
master.label-key | string | Label that will be used to identify all pods contending the lock. Defaults to "camel.apache.org/integration". |
master.label-value | string | Label value that will be used to identify all pods contending the lock. Defaults to the integration name. |
6.2.10. Prometheus Trait
The Prometheus trait configures the Prometheus JMX exporter and exposes the integration with a Service
and a ServiceMonitor
resources so that the Prometheus endpoint can be scraped.
The creation of the ServiceMonitor
resource requires the Prometheus Operator custom resource definition to be installed. You can set service-monitor
to false
for the Prometheus trait to work without the Prometheus operator.
It’s disabled by default.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
6.2.10.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait prometheus.[key]=[value] --trait prometheus.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
prometheus.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
prometheus.port | int |
The Prometheus endpoint port (default |
prometheus.service-monitor | bool |
Whether a |
prometheus.service-monitor-labels | string |
The |
prometheus.configmap | string |
To use a custom ConfigMap containing the Prometheus exporter configuration (under the |
6.2.11. Quarkus Trait
The Quarkus trait activates the Quarkus runtime.
It’s disabled by default.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
6.2.11.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait quarkus.[key]=[value] --trait quarkus.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
quarkus.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
quarkus.native | bool | The Quarkus runtime type (reserved for future use) |
6.2.12. Route Trait
The Route trait can be used to configure the creation of OpenShift routes for the integration.
This trait is available in the following profiles: OpenShift.
6.2.12.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait route.[key]=[value] --trait route.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
route.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
route.host | string | To configure the host exposed by the route. |
route.tls-termination | string |
The TLS termination type, like Refer to the OpenShift documentation for additional information. |
route.tls-certificate | string | The TLS certificate contents. Refer to the OpenShift documentation for additional information. |
route.tls-key | string | The TLS certificate key contents. Refer to the OpenShift documentation for additional information. |
route.tls-ca-certificate | string | The TLS cert authority certificate contents. Refer to the OpenShift documentation for additional information. |
route.tls-destination-ca-certificate | string | The destination CA certificate provides the contents of the ca certificate of the final destination. When using reencrypt termination this file should be provided in order to have routers use it for health checks on the secure connection. If this field is not specified, the router may provide its own destination CA and perform hostname validation using the short service name (service.namespace.svc), which allows infrastructure generated certificates to automatically verify. Refer to the OpenShift documentation for additional information. |
route.tls-insecure-edge-termination-policy | string |
To configure how to deal with insecure traffic, e.g. Refer to the OpenShift documentation for additional information. |
6.2.13. Service Trait
The Service trait exposes the integration with a Service resource so that it can be accessed by other applications (or integrations) in the same namespace.
It’s enabled by default if the integration depends on a Camel component that can expose a HTTP endpoint.
This trait is available in the following profiles: Kubernetes, OpenShift.
6.2.13.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait service.[key]=[value] --trait service.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
service.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
service.auto | bool | To automatically detect from the code if a Service needs to be created. |
6.3. Camel K platform traits
6.3.1. Builder Trait
The builder trait is internally used to determine the best strategy to build and configure IntegrationKits.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
The builder trait is a platform trait: disabling it may compromise the platform functionality.
6.3.1.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait builder.[key]=[value] --trait builder.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
builder.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
builder.verbose | bool | Enable verbose logging on build components that support it (e.g., OpenShift build pod). Kaniko and Buildah are not supported. |
6.3.2. Container Trait
The Container trait can be used to configure properties of the container where the integration will run.
It also provides configuration for Services associated to the container.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
The container trait is a platform trait: disabling it may compromise the platform functionality.
6.3.2.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait container.[key]=[value] --trait container.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
container.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
container.auto | bool | |
container.request-cpu | string | The minimum amount of CPU required. |
container.request-memory | string | The minimum amount of memory required. |
container.limit-cpu | string | The maximum amount of CPU required. |
container.limit-memory | string | The maximum amount of memory required. |
container.expose | bool | Can be used to enable/disable exposure via kubernetes Service. |
container.port | int |
To configure a different port exposed by the container (default |
container.port-name | string |
To configure a different port name for the port exposed by the container (default |
container.service-port | int |
To configure under which service port the container port is to be exposed (default |
container.service-port-name | string |
To configure under which service port name the container port is to be exposed (default |
container.name | string |
The main container name. It’s named |
container.probes-enabled | bool |
ProbesEnabled enable/disable probes on the container (default |
container.probe-path | string |
Path to access on the probe ( default |
container.liveness-initial-delay | int32 | Number of seconds after the container has started before liveness probes are initiated. |
container.liveness-timeout | int32 | Number of seconds after which the probe times out. Applies to the liveness probe. |
container.liveness-period | int32 | How often to perform the probe. Applies to the liveness probe. |
container.liveness-success-threshold | int32 | Minimum consecutive successes for the probe to be considered successful after having failed. Applies to the liveness probe. |
container.liveness-failure-threshold | int32 | Minimum consecutive failures for the probe to be considered failed after having succeeded. Applies to the liveness probe. |
container.readiness-initial-delay | int32 | Number of seconds after the container has started before readiness probes are initiated. |
container.readiness-timeout | int32 | Number of seconds after which the probe times out. Applies to the readiness probe. |
container.readiness-period | int32 | How often to perform the probe. Applies to the readiness probe. |
container.readiness-success-threshold | int32 | Minimum consecutive successes for the probe to be considered successful after having failed. Applies to the readiness probe. |
container.readiness-failure-threshold | int32 | Minimum consecutive failures for the probe to be considered failed after having succeeded. Applies to the readiness probe. |
6.3.3. Camel Trait
The Camel trait can be used to configure versions of Apache Camel K runtime and related libraries, it cannot be disabled.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
The camel trait is a platform trait: disabling it may compromise the platform functionality.
6.3.3.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait camel.[key]=[value] --trait camel.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
camel.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
camel.runtime-version | string | The camel-k-runtime version to use for the integration. It overrides the default version set in the Integration Platform. |
6.3.4. Dependencies Trait
The Dependencies trait is internally used to automatically add runtime dependencies based on the integration that the user wants to run.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
The dependencies trait is a platform trait: disabling it may compromise the platform functionality.
6.3.4.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait dependencies.[key]=[value] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
dependencies.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
6.3.5. Deployer Trait
The deployer trait can be used to explicitly select the kind of high level resource that will deploy the integration.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
The deployer trait is a platform trait: disabling it may compromise the platform functionality.
6.3.5.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait deployer.[key]=[value] --trait deployer.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
deployer.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
deployer.kind | string |
Allows to explicitly select the desired deployment kind between |
6.3.6. Deployment Trait
The Deployment trait is responsible for generating the Kubernetes deployment that will make sure the integration will run in the cluster.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
The deployment trait is a platform trait: disabling it may compromise the platform functionality.
6.3.6.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait deployment.[key]=[value] --trait deployment.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
deployment.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
6.3.7. Environment Trait
The environment trait is used internally to inject standard environment variables in the integration container, such as NAMESPACE
, POD_NAME
and others.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
The environment trait is a platform trait: disabling it may compromise the platform functionality.
6.3.7.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait environment.[key]=[value] --trait environment.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
environment.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
environment.container-meta | bool |
6.3.8. Jvm Trait
The JVM trait is used to configure the JVM that runs the integration.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
The jvm trait is a platform trait: disabling it may compromise the platform functionality.
6.3.8.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait jvm.[key]=[value] --trait jvm.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
jvm.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
jvm.debug | bool | Activates remote debugging, so that a debugger can be attached to the JVM, e.g., using port-forwarding |
jvm.debug-suspend | bool | Suspends the target JVM immediately before the main class is loaded |
jvm.debug-address | string | Transport address at which to listen for the newly launched JVM |
jvm.options | string | A comma-separated list of JVM options |
6.3.9. OpenAPI
The OpenAPI DSL trait is internally used to allow creating integrations from a OpenAPI specs.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
The openapi trait is a platform trait: disabling it may compromise the platform functionality.
6.3.9.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait openapi.[key]=[value] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
openapi.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
6.3.10. Owner Trait
The Owner trait ensures that all created resources belong to the integration being created and transfers annotations and labels on the integration onto these owned resources.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
The owner trait is a platform trait: disabling it may compromise the platform functionality.
6.3.10.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait owner.[key]=[value] --trait owner.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
owner.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
owner.target-annotations | string | The annotations to be transferred (A comma-separated list of label keys) |
owner.target-labels | string | The labels to be transferred (A comma-separated list of label keys) |
6.3.11. Platform Trait
The platform trait is a base trait that is used to assign an integration platform to an integration.
In case the platform is missing, the trait is allowed to create a default platform. This feature is especially useful in contexts where there’s no need to provide a custom configuration for the platform (e.g. on OpenShift the default settings work, since there’s an embedded container image registry).
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
The platform trait is a platform trait: disabling it may compromise the platform functionality.
6.3.11.1. Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait platform.[key]=[value] --trait platform.[key2]=[value2] Integration.java
The following configuration options are available:
Property | Type | Description |
---|---|---|
platform.enabled | bool | Can be used to enable or disable a trait. All traits share this common property. |
platform.create-default | bool | To create a default (empty) platform when the platform is missing. |
platform.auto | bool | To automatically detect from the environment if a default platform can be created (it will be created on OpenShift only). |