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.

this trait is automatically disabled if the Knative Service trait is enabled.

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, Knative, OpenShift.

Configuration

Trait properties can be specified when running any integration with the CLI:

$ kamel run --trait service.[key]=[value] --trait service.[key2]=[value2] integration.yaml

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.

service.node-port

bool

Enable Service to be exposed as NodePort (default false). Deprecated: Use service type instead.

service.type

github.com/apache/camel-k/v2/pkg/apis/camel/v1/trait.ServiceType

The type of service to be used, either 'ClusterIP', 'NodePort' or 'LoadBalancer'.

service.annotations

map[string]string

The annotations added to the Service object.

service.labels

map[string]string

The labels added to the Service object.