Knative Service Trait
The Knative Service trait allows configuring options when running the Integration as a Knative service, instead of a standard Kubernetes Deployment.
Running an Integration as a Knative Service enables auto-scaling (and scaling-to-zero), but those features are only relevant when the Camel route(s) use(s) an HTTP endpoint consumer.
This trait is available in the following profiles: Knative.
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.groovy
The following configuration options are available:
Property | Type | Description |
---|---|---|
|
| Can be used to enable or disable a trait. All traits share this common property. |
|
| The annotations added to route. This can be used to set knative service specific annotations CLI usage example: -t "knative-service.annotations.'haproxy.router.openshift.io/balance'=true" |
|
| Configures the Knative autoscaling class property (e.g. to set Refer to the Knative documentation for more information. |
|
| Configures the Knative autoscaling metric property (e.g. to set Refer to the Knative documentation for more information. |
|
| Sets the allowed concurrency level or CPU percentage (depending on the autoscaling metric) for each Pod. Refer to the Knative documentation for more information. |
|
| 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. |
|
| 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. |
|
| Enables to gradually shift traffic to the latest Revision and sets the rollout duration. It’s disabled by default and must be expressed as a Golang |
|
| Setting Refer to the Knative documentation for more information. |
|
| Automatically deploy the integration as Knative service when all conditions hold:
|