Chapter 4. Kamelets reference
4.1. Kamelet structure Copy linkLink copied to clipboard!
A Kamelet is typically coded in the YAML domain-specific language. The file name prefix is the name of the Kamelet. For example, a Kamelet with the name FTP sink has the filename ftp-sink.kamelet.yaml
.
Note that in OpenShift, a Kamelet is a resource that shows the name of the Kamelet (not the filename).
At a high level, a Kamelet resource describes:
-
A metadata section containing the ID of the Kamelet and other information, such as the type of Kamelet (
source
,sink
, oraction
). - A definition (JSON-schema specification) that contains a set of parameters that you can use to configure the Kamelet.
-
An optional
types
section containing information about input and output expected by the Kamelet. - A Camel template in YAML DSL that defines the implementation of the Kamelet.
The following diagram shows an example of a Kamelet and its parts.
Example Kamelet structure
- The Kamelet ID - Use this ID in Camel K integrations when you want to reference the Kamelet.
- Annotations, such as icon, provide display features for the Kamelet.
- Labels allow a user to query Kamelets (for example, by kind: "source", "sink", or “action”)
- Description of the Kamelet and parameters in JSON-schema specification format.
- The media type of the output (can include a schema).
- The route template that defines the behavior of the Kamelet.
4.2. Example source Kamelet Copy linkLink copied to clipboard!
Here is the content of the example coffee-source
Kamelet: