Chapter 9. Camel K command reference

This chapter provides reference details on the Camel K command line interface (CLI), and provides examples of using the kamel command. This chapter also provides reference details on Camel K modeline options that you can specify in a Camel K integration source file, which are executed at runtime.

This chapter includes the following sections:

9.1. Camel K command line

The Camel K CLI provides the kamel command as the main entry point for running Camel K integrations on OpenShift. This section provides details on the most commonly used kamel commands.

Table 9.1. kamel commands

NameDescriptionExample

help

Get the full list of available commands. You can enter --help as a parameter to each command for more details.

  • kamel help
  • kamel run --help

init

Initialize an empty Camel K file implemented in Java, XML, or YAML.

kamel init MyIntegration.java

run

Run an integration on OpenShift.

kamel run MyIntegration.java

debug

Debug a remote integration using a local debugger.

kamel debug my-integration

get

Get integrations deployed on OpenShift.

kamel get

describe

Get detailed information on a Camel K resource. This includes an integration, kit, or platform.

kamel describe integration my-integration

log

Print the logs of a running integration.

kamel log my-integration

delete

Delete an integration deployed on OpenShift.

kamel delete my-integration

9.2. Camel K modeline options

You can use the Camel K modeline to enter configuration options in a Camel K integration source file, which are executed at runtime, for example, using kamel run MyIntegration.java. For more details, see Section 3.7, “Running Camel K integrations using modeline”.

This section provides reference details about the most commonly used modeline options.

Table 9.2. Camel K modeline options

OptionDescription

dependency

Add an external library to be included in the integration. For example, for Maven, use dependency=mvn:org.my/app:1.0, or for GitHub, use dependency=github:my-account:camel-k-example-project:master.

env

Set an environment variable in the integration container. For example, env=MY_ENV_VAR=my-value.

label

Add a label for the integration. For example, label=my.company=hello.

name

Add an integration name. For example, name=my-integration.

open-api

Add an OpenAPI v2 specification. For example, open-api=path/to/my-hello-api.json.

profile

Set the Camel K trait profile used for deployment. For example, openshift.

property

Add a integration property. For example, property=my.message="Hola Mundo".

property-file

Bind a property file to the integration. For example, property-file=my-integration.properties.

resource

Add an external resource. For example, resource=path/to/my-hello.txt.

trait

Configure a Camel K feature or core capability in a trait. For example, trait=cron.enabled=true.