Keda Trait
The KEDA trait allows you to configure KEDA autoscalers to scale up and down based of events.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
Configuration
Trait properties can be specified when running any integration with the CLI:
$ kamel run --trait keda.[key]=[value] --trait keda.[key2]=[value2] integration.yaml The following configuration options are available:
| Property | Type | Description |
|---|---|---|
|
| Can be used to enable or disable a trait. All traits share this common property. |
|
| Interval (seconds) to check each trigger on. |
|
| The wait period between the last active trigger reported and scaling the resource back to 0. |
|
| Enabling this property allows KEDA to scale the resource down to the specified number of replicas. |
|
| Minimum number of replicas. |
|
| Maximum number of replicas. |
|
| Definition of triggers according to the KEDA format. Each trigger must contain |
|
| Automatically discover KEDA triggers from Camel component URIs. |
|
| Additional metadata to merge into auto-discovered triggers. Keys are trigger types (e.g., "kafka"), values are maps of metadata key-value pairs to merge (e.g., {"lagThreshold": "10"}). |
the variable names are "snake case" if you’re using in kamel CLI, for example trait.myParam has to be translated as -t trait.my-param |
Automatic scaler discovery
When keda.auto is enabled, Camel K inspects the consumer endpoints in an Integration and creates KEDA triggers for components with a registered scaler mapping. A scaler is the KEDA adapter that reads metrics from an external system and uses them to determine when a workload should scale. See the KEDA scaler concepts documentation for more information.
Automatic discovery currently supports the following Camel component:
-
kafka: creates an Apache Kafka trigger from the topic, broker, and consumer-group values in the endpoint URI. See the KEDA Apache Kafka scaler documentation for the available trigger metadata.
Unsupported Camel components do not produce an automatically discovered trigger. You can still configure their KEDA triggers explicitly with keda.triggers.