From 8a78c36a9a3c88d10fef2b1ef9aef96a3e0695d7 Mon Sep 17 00:00:00 2001 From: Thomas Diesler Date: Wed, 15 May 2024 15:13:11 +0200 Subject: [PATCH] (#5489) Use yaml in docs --- .gitignore | 3 +- README.adoc | 15 ++-- docs/local-build.sh | 3 +- .../camel-k-pipeline-task-definition.yaml | 2 +- .../configuration/build-time-properties.adoc | 44 +++++++---- .../ROOT/pages/configuration/components.adoc | 27 +++++-- .../pages/configuration/configuration.adoc | 19 +++-- .../pages/configuration/maven-profile.adoc | 2 +- .../pages/configuration/runtime-config.adoc | 74 +++++++++++-------- .../configuration/runtime-properties.adoc | 65 ++++++++++------ .../configuration/runtime-resources.adoc | 57 ++++++++------ docs/modules/ROOT/pages/index.adoc | 27 ++++--- .../advanced/multi-architecture.adoc | 6 +- .../ROOT/pages/kamelets/kamelets-user.adoc | 71 ++++++++++-------- docs/modules/ROOT/pages/languages/groovy.adoc | 5 +- docs/modules/ROOT/pages/running/running.adoc | 30 +++++--- docs/modules/traits/pages/3scale.adoc | 2 +- docs/modules/traits/pages/affinity.adoc | 2 +- .../traits/pages/aws-secrets-manager.adoc | 2 +- .../modules/traits/pages/azure-key-vault.adoc | 2 +- docs/modules/traits/pages/builder.adoc | 4 +- docs/modules/traits/pages/camel.adoc | 2 +- docs/modules/traits/pages/container.adoc | 2 +- docs/modules/traits/pages/cron.adoc | 2 +- docs/modules/traits/pages/deployer.adoc | 2 +- docs/modules/traits/pages/deployment.adoc | 2 +- docs/modules/traits/pages/environment.adoc | 2 +- docs/modules/traits/pages/error-handler.adoc | 2 +- docs/modules/traits/pages/gc.adoc | 2 +- .../traits/pages/gcp-secret-manager.adoc | 2 +- .../modules/traits/pages/hashicorp-vault.adoc | 2 +- docs/modules/traits/pages/health.adoc | 2 +- docs/modules/traits/pages/ingress.adoc | 2 +- docs/modules/traits/pages/istio.adoc | 2 +- docs/modules/traits/pages/jolokia.adoc | 2 +- docs/modules/traits/pages/jvm.adoc | 2 +- docs/modules/traits/pages/kamelets.adoc | 2 +- docs/modules/traits/pages/keda.adoc | 2 +- .../modules/traits/pages/knative-service.adoc | 2 +- docs/modules/traits/pages/knative.adoc | 2 +- docs/modules/traits/pages/logging.adoc | 2 +- docs/modules/traits/pages/master.adoc | 2 +- docs/modules/traits/pages/mount.adoc | 2 +- docs/modules/traits/pages/openapi.adoc | 2 +- docs/modules/traits/pages/owner.adoc | 2 +- docs/modules/traits/pages/pdb.adoc | 2 +- docs/modules/traits/pages/platform.adoc | 2 +- docs/modules/traits/pages/pod.adoc | 35 +++++---- docs/modules/traits/pages/prometheus.adoc | 2 +- docs/modules/traits/pages/pull-secret.adoc | 2 +- docs/modules/traits/pages/quarkus.adoc | 2 +- docs/modules/traits/pages/registry.adoc | 2 +- docs/modules/traits/pages/resume.adoc | 2 +- docs/modules/traits/pages/route.adoc | 2 +- .../traits/pages/security-context.adoc | 2 +- .../modules/traits/pages/service-binding.adoc | 2 +- docs/modules/traits/pages/service.adoc | 2 +- docs/modules/traits/pages/telemetry.adoc | 2 +- docs/modules/traits/pages/toleration.adoc | 2 +- docs/modules/traits/pages/tracing.adoc | 2 +- docs/modules/traits/pages/traits.adoc | 7 +- 61 files changed, 348 insertions(+), 232 deletions(-) diff --git a/.gitignore b/.gitignore index ef4f286cff..7e62d4fbd9 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ index.Dockerfile .gopath # Temporary Build Files +/api_* build/_output build/_offline build/camel-k-runtime-*-maven-offline.tar.gz @@ -49,7 +50,7 @@ build/_maven_overlay/ build/maven/target/ build/maven build/m2 -/api_* +_scratch/ # YAKS test output .yaks-jbang/ diff --git a/README.adoc b/README.adoc index ae0d17f361..1835498d9b 100644 --- a/README.adoc +++ b/README.adoc @@ -28,15 +28,18 @@ https://camel.apache.org/camel-k/next/installation/installation.html[Installatio You can use Camel DSL to define your `Integration`. Just save it in a file and use `kamel` command line interface (https://github.com/apache/camel-k/releases/latest[download latest release]) to run it. As an example, just try running: -[source,groovy] -.hello.groovy +[source,yaml] +.hello.yaml ---- -from('timer:tick?period=3000') - .setBody().constant('Hello world from Camel K') - .to('log:info') +- from: + uri: "timer:tick?period=3000" + steps: + - setBody: + constant: "Hello world from Camel K" + - to: "log:info" ---- ---- -kamel run hello.groovy +kamel run hello.yaml ---- You can even run your integrations in a `dev` mode. Change the code and see the **changes automatically applied (instantly)** to the remote integration pod! We have provided link:/examples[more examples] that you can use to inspire your next `Integration` development. diff --git a/docs/local-build.sh b/docs/local-build.sh index 6e0b63f892..471f366c1a 100755 --- a/docs/local-build.sh +++ b/docs/local-build.sh @@ -17,7 +17,8 @@ # limitations under the License. # -CW=./../../camel-website +SCRIPT_DIR=$(dirname $0) +CW=${SCRIPT_DIR}/../../camel-website LOCAL=./../camel-k cd $CW || (echo 'camel-website not in expected location $CW' && exit) diff --git a/docs/modules/ROOT/attachments/tekton/camel-k-pipeline-task-definition.yaml b/docs/modules/ROOT/attachments/tekton/camel-k-pipeline-task-definition.yaml index 220e434555..97b30e52ec 100644 --- a/docs/modules/ROOT/attachments/tekton/camel-k-pipeline-task-definition.yaml +++ b/docs/modules/ROOT/attachments/tekton/camel-k-pipeline-task-definition.yaml @@ -87,4 +87,4 @@ spec: resource: source-repo params: - name: file - value: "examples/tekton/hello.groovy" + value: "examples/tekton/hello.yaml" diff --git a/docs/modules/ROOT/pages/configuration/build-time-properties.adoc b/docs/modules/ROOT/pages/configuration/build-time-properties.adoc index b8d239eb9e..3393e74c56 100644 --- a/docs/modules/ROOT/pages/configuration/build-time-properties.adoc +++ b/docs/modules/ROOT/pages/configuration/build-time-properties.adoc @@ -8,17 +8,21 @@ You may be required to provide certain *build-time properties* that are needed o You will find this feature very useful when dealing with configuration that affects how `Quarkus` builds the `Integration`. For example, let's see how to override the default `quarkus.application.name` expected by any `Quarkus` application: -[source,groovy] -.build-property-route.groovy +[source,yaml] +.build-property-route.yaml ---- -from('timer:build-property') - .log('The application name: {{quarkus.application.name}}') +- from: + uri: "timer:build-property" + steps: + - setBody: + simple: "The application name: {{quarkus.application.name}}" + - to: "log:info" ---- In order to give a value to the `quarkus.application.name` property you can pass it using the command line with the `--build-property` flag: ---- -kamel run --build-property=quarkus.application.name=my-super-application build-property-route.groovy +kamel run --build-property=quarkus.application.name=my-super-application build-property-route.yaml ---- You can provide more than one single `build-property` at once by just adding the flag repeatedly (ie, `--build-property=prop1=val1 --build-property=prop2=val2 ...`) @@ -35,17 +39,21 @@ quarkus.application.name = my-super-application quarkus.banner.enabled = true ---- -[source,groovy] -.build-property-route.groovy +[source,yaml] +.build-property-route.yaml ---- -from('timer:build-property') - .log('The application name: {{quarkus.application.name}}') +- from: + uri: "timer:build-property" + steps: + - setBody: + simple: "The application name: {{quarkus.application.name}}" + - to: "log:info" ---- The `quarkus.banner.enabled` is configured to show the banner during the `Integration` startup. Let's use `--build-property` flag in conjunction with file: ---- -kamel run --build-property=file:quarkus.properties build-property-route.groovy +kamel run --build-property=file:quarkus.properties build-property-route.yaml ---- The property file is parsed and its properties configured on the `Integration`. As soon as the application starts, you will see the log with the expected configuration. @@ -63,17 +71,21 @@ kubectl create configmap my-cm-bp --from-literal=quarkus.application.name="my-gr Here, as an example we have create a configmap with 2 `Quarkus` properties. -[source,groovy] -.build-property-route.groovy +[source,yaml] +.build-property-route.yaml ---- -from('timer:build-property') - .log('The application name: {{quarkus.application.name}}') +- from: + uri: "timer:build-property" + steps: + - setBody: + simple: "The application name: {{quarkus.application.name}}" + - to: "log:info" ---- The `quarkus.banner.enabled` is configured to show the banner during the `Integration` startup. Let's use `--build-property` flag in conjunction with file: ---- -kamel run --build-property=configmap:my-cm-bp build-property-route.groovy +kamel run --build-property=configmap:my-cm-bp build-property-route.yaml ---- The key-value pairs of the `ConfigMap` are loaded and used as build-time properties of the `Integration`. As soon as the application starts, you will see the log with the expected configuration. @@ -105,7 +117,7 @@ kubectl create configmap my-cm-bps --from-file=quarkus.properties Then we launch the `run` command with the `--build-property` flag whose value matches with the appropriate syntax to refer to `my-cm-bps`: ---- -kamel run --build-property configmap:my-cm-bps build-property-route.groovy +kamel run --build-property configmap:my-cm-bps build-property-route.yaml ---- The value of the key-value of the `ConfigMap` is loaded as a property file and used as build-time properties of the `Integration`. you will see the log with the expected configuration. diff --git a/docs/modules/ROOT/pages/configuration/components.adoc b/docs/modules/ROOT/pages/configuration/components.adoc index ce95b99982..410c42c744 100644 --- a/docs/modules/ROOT/pages/configuration/components.adoc +++ b/docs/modules/ROOT/pages/configuration/components.adoc @@ -2,19 +2,36 @@ Camel components can be configured programmatically (within the integration code) or using properties with the following syntax: -``` +[source] +---- camel.component.${scheme}.${property}=${value} -``` +---- As example if you want to change the queue size of the seda component, you can use the following property: -``` +[source] +---- camel.component.seda.queueSize=10 -``` +---- For example, you can do it when running the integration from the command line: +[source,yaml] +.config-seda-route.yaml +---- +- from: + uri: "timer:seda" + steps: + - setBody: + simple: "Hello World!" + - to: "seda:next" +- from: + uri: "seda:next" + steps: + - to: "log:info" +---- + ``` -kamel run --property camel.component.seda.queueSize=10 examples/routes.groovy +kamel run --property camel.component.seda.queueSize=10 config-seda-route.yaml ``` diff --git a/docs/modules/ROOT/pages/configuration/configuration.adoc b/docs/modules/ROOT/pages/configuration/configuration.adoc index febf7ef1a0..f44953f351 100644 --- a/docs/modules/ROOT/pages/configuration/configuration.adoc +++ b/docs/modules/ROOT/pages/configuration/configuration.adoc @@ -7,17 +7,22 @@ The property value can be used inside Camel K integrations using the *property p The syntax for properties has the form `{{my.property}}`, for example: -[source,groovy] -.props.groovy +[source,yaml] +.property-route.yaml ---- -from('timer:props?period=1000') - .log('{{my.message}}') +- from: + uri: "timer:props" + steps: + - setBody: + simple: "{{my.message}}" + - to: "log:info" ---- In order to give a value to the `my.message` property you can pass it using the command line: -``` -kamel run --property my.message="Hello World" props.groovy -``` +[source] +---- +kamel run --property my.message="Hello World" property-route.yaml +---- For more details and advanced use cases, see the xref:configuration/runtime-properties.adoc[runtime properties] section. diff --git a/docs/modules/ROOT/pages/configuration/maven-profile.adoc b/docs/modules/ROOT/pages/configuration/maven-profile.adoc index 3b6021a368..8bda1592e6 100644 --- a/docs/modules/ROOT/pages/configuration/maven-profile.adoc +++ b/docs/modules/ROOT/pages/configuration/maven-profile.adoc @@ -19,7 +19,7 @@ kubectl create cm my-maven-profile --from-file my-profile.xml Once the Configmap/Secret is ready, then, you can use it to run your integration: ``` -kamel run hello.groovy -t builder.maven-profile=configmap:my-maven-profile/my-profile.xml +kamel run hello.yaml -t builder.maven-profile=configmap:my-maven-profile/my-profile.xml ``` The profile will be added to your integration's project generated pom file. What will be changed in the `mvn package` execution will depend on your profile definition. diff --git a/docs/modules/ROOT/pages/configuration/runtime-config.adoc b/docs/modules/ROOT/pages/configuration/runtime-config.adoc index 2c616b9a8b..cce2072b35 100644 --- a/docs/modules/ROOT/pages/configuration/runtime-config.adoc +++ b/docs/modules/ROOT/pages/configuration/runtime-config.adoc @@ -20,19 +20,23 @@ kubectl create configmap my-cm --from-literal=my-configmap-key="configmap conten We want to use the materialized file in an integration: -[source,groovy] -.config-configmap-route.groovy +[source,yaml] +.config-configmap-route.yaml ---- -from('timer:configmap') - .setBody() - .simple("resource:classpath:my-configmap-key") - .log('configmap content is: ${body}') +- from: + uri: "timer:configmap" + steps: + - setBody: + simple: "resource:classpath:my-configmap-key" + - setBody: + simple: "configmap content is: ${body}" + - to: "log:info" ---- You can see that we're expecting to use a _my-configmap-key_ file stored somewhere in the classpath. In order to materialize the `Configmap` will be as easy as running the `--config` _configmap_ syntax: ---- -kamel run --config configmap:my-cm config-configmap-route.groovy +kamel run --config configmap:my-cm config-configmap-route.yaml ---- As soon as the `Integration` starts, the `Camel K` operator will take care to mount a volume with the `Configmap` 's content. @@ -52,19 +56,23 @@ kubectl create secret generic my-sec --from-literal=my-secret-key="very top secr We want to use the materialized secret file in an integration: -[source,groovy] -.config-secret-route.groovy +[source,yaml] +.config-secret-route.yaml ---- -from('timer:secret') - .setBody() - .simple("resource:classpath:my-secret-key") - .log('secret content is: ${body}') +- from: + uri: "timer:secret" + steps: + - setBody: + simple: "resource:classpath:my-secret-key" + - setBody: + simple: "secret content is: ${body}" + - to: "log:info" ---- You can see that we're expecting to use a _my-secret-key_ file stored somewhere in the classpath. In order to materialize the `Secret` will be as easy as running the `--config` _secret_ syntax: ---- -kamel run --config secret:my-sec config-secret-route.groovy +kamel run --config secret:my-sec config-secret-route.yaml ---- As soon as the `Integration` starts, the `Camel K` operator will take care to mount a volume with the `Secret` 's content. @@ -77,29 +85,33 @@ NOTE: you can provide a `Secret` which is not yet available on the cluster. The Each `Configmap`/`Secret` will be parsed as a property file and you will be able to use those properties inside your `Route` definition or, more in general, as you would do with any other xref:configuration/runtime-properties.adoc[runtime property]. As an example, you can create the following `Secret`: [source,text] -.my.properties +.secret.properties ---- my.key.1=hello my.key.2=world ---- + ---- -kubectl create secret generic my-secret-properties --from-file=my.properties +kubectl create secret generic my-secret-properties --from-file=secret.properties ---- In our `Integration` we can simply refer the properties defined in the `Secret` as we would do with any other property: -[source,groovy] -.config-secret-property-route.groovy +[source,yaml] +.config-secret-property-route.yaml ---- -from('timer:secret') - .routeId('secret') - .log('{{my.key.1}} {{my.key.2}}') +- from: + uri: "timer:secret" + steps: + - setBody: + simple: "{{my.key.1}} {{my.key.2}}" + - to: "log:info" ---- We just have to provide the `--config` we are willing to use: ---- -kamel run --config secret:my-secret-properties config-secret-property-route.groovy +kamel run --config secret:my-secret-properties config-secret-property-route.yaml ---- [[runtime-config-keys]] @@ -115,19 +127,23 @@ kubectl create secret generic my-sec-multi --from-literal=my-secret-key="very to In our `Integration` we plan to use only one of the resources of the `Secret`: -[source,groovy] -.config-secret-key-route.groovy +[source,yaml] +.config-secret-key-route.yaml ---- -from('timer:secret') - .setBody() - .simple("resource:classpath:my-secret-key-2") - .log('secret content is: ${body}') +- from: + uri: "timer:secret" + steps: + - setBody: + simple: "resource:classpath:my-secret-key-2" + - setBody: + simple: "secret content is: ${body}" + - to: "log:info" ---- Let's use the _key_ filtering: ---- -kamel run --config secret:my-sec-multi/my-secret-key-2 config-secret-key-route.groovy +kamel run --config secret:my-sec-multi/my-secret-key-2 config-secret-key-route.yaml ---- You may check in the `Integration` `Pod` that only the _my-secret-key-2_ data has been mounted. diff --git a/docs/modules/ROOT/pages/configuration/runtime-properties.adoc b/docs/modules/ROOT/pages/configuration/runtime-properties.adoc index 6ea9616400..f4fb39d759 100644 --- a/docs/modules/ROOT/pages/configuration/runtime-properties.adoc +++ b/docs/modules/ROOT/pages/configuration/runtime-properties.adoc @@ -8,17 +8,21 @@ During the execution of an `Integration` you can provide a single property or a Imagine you have a generic `Route` and you set a placeholder for certain information (ie, _my.message_ variable): -[source,groovy] -.property-route.groovy +[source,yaml] +.property-route.yaml ---- -from('timer:property') - .log('property content is: {{my.message}}') +- from: + uri: "timer:property" + steps: + - setBody: + simple: "property content is: {{my.message}}" + - to: "log:info" ---- The simplest way to replace that variable with a real value is to use the `--property` flag (also shortcut by `-p`): ---- -kamel run -p my.message=test-property property-route.groovy +kamel run -p my.message=test-property property-route.yaml ---- At runtime, that variable will be substituted by the value you've provided. You can provide more than one single `property` at once by just adding the flag repeatedly (ie, `--property prop1=val1 --property prop2=val2 ...`) @@ -26,17 +30,23 @@ At runtime, that variable will be substituted by the value you've provided. You You can also use runtime properties in Camel endpoints, for example to make the timer period configurable you can do as follows: -[source,groovy] -.property-route.groovy +[source,yaml] +.config-property-route.yaml ---- -from('timer:property?period={{triggerPeriod}}') - .log('property content is: {{my.message}}') +- from: + uri: "timer:property" + parameters: + period: "{{triggerPeriod}}" + steps: + - setBody: + simple: "property content is: {{my.message}}" + - to: "log:info" ---- The simplest way to replace that variable with a real value is to use the `--property` flag (also shortcut by `-p`): ---- -kamel run -p my.message=test-property -p triggerPeriod=3000 property-route.groovy +kamel run -p my.message=test-property -p triggerPeriod=3000 config-property-route.yaml ---- [[runtime-props-file]] @@ -45,24 +55,27 @@ kamel run -p my.message=test-property -p triggerPeriod=3000 property-route.groov Another way to provide more property configuration at once is to use a *property file*. [source,properties] -.my.properties +.config.properties ---- my.key.1=hello my.key.2=world ---- -[source,groovy] -.property-route.groovy +[source,yaml] +.config-property-file-route.yaml ---- -from('timer:property-file') - .routeId('property-file') - .log('property file content is: {{my.key.1}} {{my.key.2}}') +- from: + uri: "timer:property-file'" + steps: + - setBody: + simple: "property file content is: {{my.key.1}} {{my.key.2}}" + - to: "log:info" ---- You'll need to provide a `property` _file_ flag when launching the application: ---- -kamel run --property file:my.properties property-route.groovy +kamel run --property file:config.properties config-property-file-route.yaml ---- The property file is parsed and its properties configured on the `Integration`. As soon as the application starts, you will see the log with the expected configuration. @@ -80,17 +93,23 @@ kubectl create configmap my-cm-rp --from-literal=name="Will Smith" --from-litera In our `Integration` we can simply refer to the properties defined in the `ConfigMap` as we'd do with any other property: -[source,groovy] -.property-configmap-route.groovy +[source,yaml] +.config-property-configmap-route.yaml ---- -from('timer:property?period={{period}}') - .log('Hello {{name}}!') +- from: + uri: "timer:property" + parameters: + period: "{{period}}" + steps: + - setBody: + simple: "Hello {{name}}!" + - to: "log:info" ---- Then we launch the `run` command with the `--property` flag whose value matches with the appropriate syntax to refer to `my-cm-rp`: ---- -kamel run --property configmap:my-cm-rp property-configmap-route.groovy +kamel run --property configmap:my-cm-rp config-property-configmap-route.yaml ---- The key-value pairs of the `ConfigMap` are loaded and used as runtime properties of the `Integration`. As soon as the application starts, you will see the log with the expected message. @@ -122,7 +141,7 @@ kubectl create configmap my-cm-rps --from-file=some.properties Then we launch the `run` command with the `--property` flag whose value matches with the appropriate syntax to refer to `my-cm-rps`: ---- -kamel run --property configmap:my-cm-rps property-configmap-route.groovy +kamel run --property configmap:my-cm-rps config-property-configmap-route.yaml ---- The value of the key-value of the `ConfigMap` is loaded as a property file and used as runtime properties of the `Integration`. As soon as the application starts, you will see the log with the expected message. diff --git a/docs/modules/ROOT/pages/configuration/runtime-resources.adoc b/docs/modules/ROOT/pages/configuration/runtime-resources.adoc index 1d43fcf828..a5aef8c923 100644 --- a/docs/modules/ROOT/pages/configuration/runtime-resources.adoc +++ b/docs/modules/ROOT/pages/configuration/runtime-resources.adoc @@ -20,17 +20,21 @@ kubectl create configmap my-cm --from-literal=my-configmap-key="configmap conten We want to use the materialized file in an integration: -[source,groovy] -.resource-configmap-route.groovy +[source,yaml] +.resource-configmap-route.yaml ---- -from('file:/etc/camel/resources/my-cm/?fileName=my-configmap-key&noop=true&idempotent=false') - .log('resource file content is: ${body}') +- from: + uri: "file:/etc/camel/resources/my-cm/?fileName=my-configmap-key&noop=true&idempotent=false" + steps: + - setBody: + simple: "resource file content is: ${body}" + - to: "log:info" ---- You can see that we're expecting to use a _my-configmap-key_ file stored in the default resource location (_/etc/camel/resources/_). In order to materialize the `Configmap` will be as easy as running the `--resource` _configmap_ syntax: ---- -kamel run --resource configmap:my-cm resource-configmap-route.groovy +kamel run --resource configmap:my-cm resource-configmap-route.yaml ---- As soon as the `Integration` starts, the `Camel K` operator will take care to mount a volume with the `Configmap` 's content. @@ -50,17 +54,21 @@ kubectl create secret generic my-sec --from-literal=my-secret-key="very top secr We want to use the materialized secret file in an integration: -[source,groovy] -.resource-secret-route.groovy +[source,yaml] +.resource-secret-route.yaml ---- -from('file:/etc/camel/resources/my-sec/?fileName=my-secret-key&noop=true&idempotent=false') - .log('resource file content is: ${body}') +- from: + uri: "file:/etc/camel/resources/my-sec/?fileName=my-secret-key&noop=true&idempotent=false" + steps: + - setBody: + simple: "secret file content is: ${body}" + - to: "log:info" ---- You can see that we're expecting to use a _my-secret-key_ file stored in the default resource location (_/etc/camel/resources/_). In order to materialize the `Secret` will be as easy as running the `--resource` _secret_ syntax: ---- -kamel run --resource secret:my-sec resource-secret-route.groovy +kamel run --resource secret:my-sec resource-secret-route.yaml ---- As soon as the `Integration` starts, the `Camel K` operator will take care to mount a volume with the `Secret` 's content. @@ -78,20 +86,23 @@ As an example, let's create a `Configmap` named _my-cm_ containing certain infor kubectl create configmap my-cm-files --from-literal=input.txt="configmap input.txt content" ---- - Let's see an example where your integration expect a text file to be consumed under a specific filesystem location: -[source,groovy] -.resource-file-location-route.groovy +[source,yaml] +.resource-file-location-route.yaml ---- -from('file:/tmp/inputs/?fileName=input.txt&noop=true&idempotent=false') - .log('resource file content is: ${body}') +- from: + uri: "file:/tmp/inputs/?fileName=input.txt&noop=true&idempotent=false" + steps: + - setBody: + simple: "resource file content is: ${body}" + - to: "log:info" ---- When running the `Integration`, you can specify where to mount the resource content (either a `File`, `Configmap` or `Secret`) with the _@path_ syntax: ---- -kamel run --resource configmap:my-cm-files@/tmp/inputs resource-file-location-route.groovy +kamel run --resource configmap:my-cm-files@/tmp/inputs resource-file-location-route.yaml ---- You may check in the `Integration` `Pod` and verify that the file was mounted in the _tmp/inputs/input.txt_ destination. @@ -109,17 +120,21 @@ kubectl create configmap my-cm-multi --from-literal=my-configmap-key="configmap In our `Integration` we plan to use only one of the resources of the `Secret`: -[source,groovy] -.resource-configmap-key-location-route.groovy +[source,yaml] +.resource-configmap-key-location-route.yaml ---- -from('file:/tmp/app/data/?fileName=test.txt&noop=true&idempotent=false') - .log('resource file content is: ${body} consumed from ${header.CamelFileName}') +- from: + uri: "file:/tmp/app/data/?fileName=test.txt&noop=true&idempotent=false" + steps: + - setBody: + simple: "resource file content is: ${body} consumed from ${header.CamelFileName}" + - to: "log:info" ---- Let's use the _key_ filtering. Also notice that we're combining with the _@path_ syntax to declare where to mount the file: ---- -kamel run --resource configmap:my-cm-multi/my-configmap-key-2@/tmp/app/data/test.txt resource-configmap-key-location-route.groovy +kamel run --resource configmap:my-cm-multi/my-configmap-key-2@/tmp/app/data/test.txt resource-configmap-key-location-route.yaml ---- You may check in the `Integration` `Pod` that only the _test.txt_ file has been mounted under _/tmp/app/data_ directory containing the information you had in _my-configmap-key-2_. diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc index 4b13a02455..5608941b7b 100644 --- a/docs/modules/ROOT/pages/index.adoc +++ b/docs/modules/ROOT/pages/index.adoc @@ -24,19 +24,26 @@ Users of Camel K can instantly run integration code written in Camel DSL on thei [[how-it-works]] == How It Works -Just write a _helloworld.groovy_ integration file with the following content: - -```groovy -from('timer:tick?period=3000') - .setBody().constant('Hello world from Camel K') - .to('log:info') -``` +Just write a _helloworld.yaml_ integration file with the following content: + +[source,yaml] +---- +- from: + uri: "timer:tick" + parameters: + period: "3000" + steps: + - setBody: + simple: "Hello world from Camel K" + - to: "log:info" +---- You can then execute the following command: -``` -kamel run helloworld.groovy -``` +[source] +---- +kamel run helloworld.yaml +---- The integration code immediately runs in the cloud. **Nothing else** is needed. diff --git a/docs/modules/ROOT/pages/installation/advanced/multi-architecture.adoc b/docs/modules/ROOT/pages/installation/advanced/multi-architecture.adoc index d082b32d12..c801f1e550 100644 --- a/docs/modules/ROOT/pages/installation/advanced/multi-architecture.adoc +++ b/docs/modules/ROOT/pages/installation/advanced/multi-architecture.adoc @@ -21,14 +21,14 @@ The logs should indicate the architecture at the start of the operator pod: === Example -Once you've installed the operator you will need to specify the platform target you whish to use. This is required as each of the different publishing tasks may need to know how to create a manifest accordingly. You can use `builder.platforms` trait option to control this behavior. +The operator will by default build integrations for the same platform it is running on. It is however also possible to explicitly define the set of target platforms integrations should be built for. You can use `builder.platforms` trait option to control this behavior. NOTE: you can set the property at IntegrationPlatform level to have it for all Integrations. -Send the groovy file to kamel operator to build, publish and run it +Send the integration to the kamel operator to build, publish and run it [source,shell] ---- -kamel run hello.groovy -t builder.platforms=linux/arm64 -t builder.platforms=linux/amd64 +kamel run hello.yaml -t builder.platforms=linux/arm64 -t builder.platforms=linux/amd64 ---- You should observe base image in the logs of the operator pod: diff --git a/docs/modules/ROOT/pages/kamelets/kamelets-user.adoc b/docs/modules/ROOT/pages/kamelets/kamelets-user.adoc index 10eec3afe1..6011b4877d 100644 --- a/docs/modules/ROOT/pages/kamelets/kamelets-user.adoc +++ b/docs/modules/ROOT/pages/kamelets/kamelets-user.adoc @@ -1,7 +1,7 @@ = Kamelets user guide Speaking technically, a Kamelet is a resource that can be installed on any Kubernetes cluster. -The following is an example of Kamelet that we'll use to discuss the various parts: +The following is an example of a Kamelet that we'll use to discuss the various parts: .telegram-text-source.kamelet.yaml [source,yaml] @@ -74,7 +74,7 @@ Kamelets can be installed on a Kubernetes namespace with a simple command: [source,shell] ---- -kubectl apply -f yourkamelet.kamelet.yaml +kubectl apply -f telegram-text-source.kamelet.yaml ---- Kamelets are standard YAML files, but their common extension is `.kamelet.yaml` to help IDEs to recognize them and provide auto-completion (in the future). @@ -86,11 +86,13 @@ Kamelets can be used in integrations **as if they were standard Camel components suppose that you've created the `telegram-text-source` Kamelet in the `default` namespace on Kubernetes, then you can write the following integration to use the Kamelet: -.example.groovy -[source,groovy] +[source,yaml] +.kamlet-route.yaml ---- -from('kamelet:telegram-text-source?botToken=XXXXYYYY') - .to('log:INFO') +- from: + uri: "kamelet:telegram-text-source?botToken=XXXXYYYY" + steps: + - to: "log:info" ---- NOTE: URI properties ("botToken") match the corresponding parameters in the Kamelet definition @@ -99,13 +101,16 @@ Kamelets can also be used multiple times in the same route definition. This happ Suppose that you've defined a Kamelet named "my-company-log-sink" in your Kubernetes namespace, then you can write a route like this: -.example.groovy -[source,groovy] +[source,yaml] +.kamlet-multi-route.yaml ---- -from('kamelet:telegram-text-source?botToken=XXXXYYYY') - .to("kamelet:my-company-log-sink?bucket=general") - .filter().simple('${body} contains "Camel"') - .to("kamelet:my-company-log-sink?bucket=special") +- from: + uri: "kamelet:telegram-text-source?botToken=XXXXYYYY" + steps: + - to: "kamelet:my-company-log-sink?bucket=general" + - filter: + simple: '${body} contains "Camel"' + - to: "kamelet:my-company-log-sink?bucket=special" ---- The "my-company-log-sink" will obviously define what it means to write a log in the enterprise system and what is concretely a "bucket". @@ -119,10 +124,11 @@ loaded implicitly by the operator from Kubernetes secrets (see below). You can configure the Kamelet by passing directly the configuration parameters in the URI, as in: -[source,groovy] +[source,yaml] ---- -from("kamelet:telegram-text-source?botToken=the-token-value") -// ... +- from: + uri: "kamelet:telegram-text-source?botToken=the-token-value" +... ---- In this case, "the-token-value" is passed explicitly in the URI (you can also pass a custom property placeholder as value). @@ -133,20 +139,24 @@ An alternative way to configure the Kamelet is to provide configuration paramete Taking for example a different version of the integration above: -[source,groovy] +[source,yaml] +.kamelet-properties-route.yaml ---- -from('kamelet:telegram-text-source') - .to("kamelet:my-company-log-sink") - .filter().simple('${body} contains "Camel"') - .to("kamelet:my-company-log-sink/mynamedconfig") +- from: + uri: "kamelet:telegram-text-source" + steps: + - to: "kamelet:my-company-log-sink" + - filter: + simple: '${body} contains "Camel"' + - to: "kamelet:my-company-log-sink/mynamedconfig" ---- NOTE: The integration above does not contain URI query parameters and the last URI ("kamelet:my-company-log-sink/mynamedconfig") contains a path parameter with value "mynamedconfig" The integration above needs some configuration in order to run properly. The configuration can be provided in a property file: -.example.properties [source,properties] +.kamelet-example.properties ---- # Configuration for the Telegram source Kamelet camel.kamelet.telegram-text-source.botToken=the-token-value @@ -164,7 +174,7 @@ Then the integration can be run with the following command: [source,shell] ---- -kamel run example.groovy --property file:example.properties +kamel run kamelet-properties-route.yaml --property file:kamelet-example.properties ---- ==== 3. Implicit configuration using secrets @@ -174,8 +184,8 @@ determine the Kamelets configuration. To use implicit configuration via secret, we first need to create a configuration file holding only the properties of a named configuration. -.mynamedconfig.properties [source,properties] +.mynamedconfig.properties ---- # Only configuration related to the "mynamedconfig" named config camel.kamelet.my-company-log-sink.mynamedconfig.bucket=special @@ -194,12 +204,15 @@ kubectl label secret my-company-log-sink.mynamedconfig camel.apache.org/kamelet= You can now write an integration that uses the Kamelet with the named configuration: -.example.groovy -[source,groovy] ----- -from('timer:tick') - .setBody().constant('Hello') - .to('kamelet:my-company-log-sink/mynamedconfig') +[source,yaml] +.kamlet-namedconfig-route.yaml +---- +- from: + uri: "timer:tick" + steps: + - setBody: + constant: "Hello" + - to: "kamelet:my-company-log-sink/mynamedconfig" ---- You can run this integration without specifying other parameters, the Kamelet endpoint will be implicitly configured by the Camel K operator that will diff --git a/docs/modules/ROOT/pages/languages/groovy.adoc b/docs/modules/ROOT/pages/languages/groovy.adoc index ac8f56849b..0c3eb99b92 100644 --- a/docs/modules/ROOT/pages/languages/groovy.adoc +++ b/docs/modules/ROOT/pages/languages/groovy.adoc @@ -16,9 +16,10 @@ from('timer:tick') You can run it with the standard command: -``` +[source] +---- kamel run example.groovy -``` +---- == Configuring the Application diff --git a/docs/modules/ROOT/pages/running/running.adoc b/docs/modules/ROOT/pages/running/running.adoc index 9dd1a46084..5980c2ee3a 100644 --- a/docs/modules/ROOT/pages/running/running.adoc +++ b/docs/modules/ROOT/pages/running/running.adoc @@ -6,27 +6,33 @@ and have the `kamel` CLI correctly configured. Ensure you're connected to the cluster by executing a simple command using the Kubernetes CLI: -``` +[source] +---- kubectl get pod -``` +---- Just replace `kubectl` with `oc` if you're using OpenShift. If everything is correctly configured you should get a response from the Kubernetes API server (you should see at least the `camel-k-operator` running). -You are now ready to create your first integration using Camel K. Just create a new Groovy file with the following content: +You are now ready to create your first integration using Camel K. Just create a new Yaml file with the following content: -.hello.groovy -```groovy -from('timer:tick?period=3000') - .setBody().constant('Hello world from Camel K') - .to('log:info') -``` +[source,yaml] +.run-hello.yaml +---- +- from: + uri: "timer:tick?period=3000" + steps: + - setBody: + constant: "Hello world from Camel K" + - to: "log:info" +---- You can run it on the cluster by executing: -``` -kamel run hello.groovy -``` +[source] +---- +kamel run run-hello.yaml +---- Integrations can be written in any supported Camel DSL. We are collecting examples in our https://github.com/apache/camel-k/[Camel K GitHub repository]. diff --git a/docs/modules/traits/pages/3scale.adoc b/docs/modules/traits/pages/3scale.adoc index 4e410ddd0c..d6fd68d9e5 100755 --- a/docs/modules/traits/pages/3scale.adoc +++ b/docs/modules/traits/pages/3scale.adoc @@ -18,7 +18,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait 3scale.[key]=[value] --trait 3scale.[key2]=[value2] integration.groovy +$ kamel run --trait 3scale.[key]=[value] --trait 3scale.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/affinity.adoc b/docs/modules/traits/pages/affinity.adoc index 91691b40ff..5f9efc5e87 100755 --- a/docs/modules/traits/pages/affinity.adoc +++ b/docs/modules/traits/pages/affinity.adoc @@ -18,7 +18,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait affinity.[key]=[value] --trait affinity.[key2]=[value2] integration.groovy +$ kamel run --trait affinity.[key]=[value] --trait affinity.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/aws-secrets-manager.adoc b/docs/modules/traits/pages/aws-secrets-manager.adoc index 7bf60ee29f..96db11ead1 100644 --- a/docs/modules/traits/pages/aws-secrets-manager.adoc +++ b/docs/modules/traits/pages/aws-secrets-manager.adoc @@ -27,7 +27,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait aws-secrets-manager.[key]=[value] --trait aws-secrets-manager.[key2]=[value2] integration.groovy +$ kamel run --trait aws-secrets-manager.[key]=[value] --trait aws-secrets-manager.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/azure-key-vault.adoc b/docs/modules/traits/pages/azure-key-vault.adoc index 79873afcbe..454e11fd73 100644 --- a/docs/modules/traits/pages/azure-key-vault.adoc +++ b/docs/modules/traits/pages/azure-key-vault.adoc @@ -27,7 +27,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait azure-key-vault.[key]=[value] --trait azure-key-vault.[key2]=[value2] integration.groovy +$ kamel run --trait azure-key-vault.[key]=[value] --trait azure-key-vault.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/builder.adoc b/docs/modules/traits/pages/builder.adoc index af1d9a6c54..7f3c280f35 100755 --- a/docs/modules/traits/pages/builder.adoc +++ b/docs/modules/traits/pages/builder.adoc @@ -18,7 +18,7 @@ NOTE: The builder trait is a *platform trait* and cannot be disabled by the user Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait builder.[key]=[value] --trait builder.[key2]=[value2] integration.groovy +$ kamel run --trait builder.[key]=[value] --trait builder.[key2]=[value2] integration.yaml ---- The following configuration options are available: @@ -144,5 +144,5 @@ Node selectors can be specified when running an integration with the CLI: [source,console] ---- -$ kamel run --trait builder.node-selector.'size'=large integration.groovy +$ kamel run --trait builder.node-selector.'size'=large integration.yaml ---- diff --git a/docs/modules/traits/pages/camel.adoc b/docs/modules/traits/pages/camel.adoc index b6cde7896b..82f3810439 100755 --- a/docs/modules/traits/pages/camel.adoc +++ b/docs/modules/traits/pages/camel.adoc @@ -17,7 +17,7 @@ NOTE: The camel trait is a *platform trait* and cannot be disabled by the user. Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait camel.[key]=[value] --trait camel.[key2]=[value2] integration.groovy +$ kamel run --trait camel.[key]=[value] --trait camel.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/container.adoc b/docs/modules/traits/pages/container.adoc index 936a15665b..39551b17f6 100755 --- a/docs/modules/traits/pages/container.adoc +++ b/docs/modules/traits/pages/container.adoc @@ -19,7 +19,7 @@ NOTE: The container trait is a *platform trait* and cannot be disabled by the us Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait container.[key]=[value] --trait container.[key2]=[value2] integration.groovy +$ kamel run --trait container.[key]=[value] --trait container.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/cron.adoc b/docs/modules/traits/pages/cron.adoc index 2134f8ef20..4edbcce95b 100755 --- a/docs/modules/traits/pages/cron.adoc +++ b/docs/modules/traits/pages/cron.adoc @@ -32,7 +32,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait cron.[key]=[value] --trait cron.[key2]=[value2] integration.groovy +$ kamel run --trait cron.[key]=[value] --trait cron.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/deployer.adoc b/docs/modules/traits/pages/deployer.adoc index ebcd18e0b1..a220f1b3c4 100755 --- a/docs/modules/traits/pages/deployer.adoc +++ b/docs/modules/traits/pages/deployer.adoc @@ -18,7 +18,7 @@ NOTE: The deployer trait is a *platform trait* and cannot be disabled by the use Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait deployer.[key]=[value] --trait deployer.[key2]=[value2] integration.groovy +$ kamel run --trait deployer.[key]=[value] --trait deployer.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/deployment.adoc b/docs/modules/traits/pages/deployment.adoc index 2127bb3427..b1098aeb12 100755 --- a/docs/modules/traits/pages/deployment.adoc +++ b/docs/modules/traits/pages/deployment.adoc @@ -18,7 +18,7 @@ NOTE: The deployment trait is a *platform trait* and cannot be disabled by the u Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait deployment.[key]=[value] --trait deployment.[key2]=[value2] integration.groovy +$ kamel run --trait deployment.[key]=[value] --trait deployment.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/environment.adoc b/docs/modules/traits/pages/environment.adoc index adfdca710b..d40ab6a5a6 100755 --- a/docs/modules/traits/pages/environment.adoc +++ b/docs/modules/traits/pages/environment.adoc @@ -18,7 +18,7 @@ NOTE: The environment trait is a *platform trait* and cannot be disabled by the Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait environment.[key]=[value] --trait environment.[key2]=[value2] integration.groovy +$ kamel run --trait environment.[key]=[value] --trait environment.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/error-handler.adoc b/docs/modules/traits/pages/error-handler.adoc index 4695216cbc..d30201802d 100755 --- a/docs/modules/traits/pages/error-handler.adoc +++ b/docs/modules/traits/pages/error-handler.adoc @@ -17,7 +17,7 @@ NOTE: The error-handler trait is a *platform trait* and cannot be disabled by th Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait error-handler.[key]=[value] --trait error-handler.[key2]=[value2] integration.groovy +$ kamel run --trait error-handler.[key]=[value] --trait error-handler.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/gc.adoc b/docs/modules/traits/pages/gc.adoc index 86827d06fb..a16cd570a8 100755 --- a/docs/modules/traits/pages/gc.adoc +++ b/docs/modules/traits/pages/gc.adoc @@ -15,7 +15,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait gc.[key]=[value] --trait gc.[key2]=[value2] integration.groovy +$ kamel run --trait gc.[key]=[value] --trait gc.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/gcp-secret-manager.adoc b/docs/modules/traits/pages/gcp-secret-manager.adoc index ab754fc4e5..257f1824c7 100644 --- a/docs/modules/traits/pages/gcp-secret-manager.adoc +++ b/docs/modules/traits/pages/gcp-secret-manager.adoc @@ -27,7 +27,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait gcp-secret-manager.[key]=[value] --trait gcp-secret-manager.[key2]=[value2] integration.groovy +$ kamel run --trait gcp-secret-manager.[key]=[value] --trait gcp-secret-manager.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/hashicorp-vault.adoc b/docs/modules/traits/pages/hashicorp-vault.adoc index 337f86ae7c..8adb2106b1 100644 --- a/docs/modules/traits/pages/hashicorp-vault.adoc +++ b/docs/modules/traits/pages/hashicorp-vault.adoc @@ -23,7 +23,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait hashicorp-vault.[key]=[value] --trait hashicorp-vault.[key2]=[value2] integration.groovy +$ kamel run --trait hashicorp-vault.[key]=[value] --trait hashicorp-vault.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/health.adoc b/docs/modules/traits/pages/health.adoc index d6c4a1087b..d8f1dcba0e 100755 --- a/docs/modules/traits/pages/health.adoc +++ b/docs/modules/traits/pages/health.adoc @@ -17,7 +17,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait health.[key]=[value] --trait health.[key2]=[value2] integration.groovy +$ kamel run --trait health.[key]=[value] --trait health.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/ingress.adoc b/docs/modules/traits/pages/ingress.adoc index 788eed27a9..bf26cee14c 100755 --- a/docs/modules/traits/pages/ingress.adoc +++ b/docs/modules/traits/pages/ingress.adoc @@ -18,7 +18,7 @@ This trait is available in the following profiles: **Kubernetes**. Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait ingress.[key]=[value] --trait ingress.[key2]=[value2] integration.groovy +$ kamel run --trait ingress.[key]=[value] --trait ingress.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/istio.adoc b/docs/modules/traits/pages/istio.adoc index 4c707c3917..230f567bb7 100755 --- a/docs/modules/traits/pages/istio.adoc +++ b/docs/modules/traits/pages/istio.adoc @@ -16,7 +16,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait istio.[key]=[value] --trait istio.[key2]=[value2] integration.groovy +$ kamel run --trait istio.[key]=[value] --trait istio.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/jolokia.adoc b/docs/modules/traits/pages/jolokia.adoc index 3ce989fc29..59456761bf 100755 --- a/docs/modules/traits/pages/jolokia.adoc +++ b/docs/modules/traits/pages/jolokia.adoc @@ -17,7 +17,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait jolokia.[key]=[value] --trait jolokia.[key2]=[value2] integration.groovy +$ kamel run --trait jolokia.[key]=[value] --trait jolokia.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/jvm.adoc b/docs/modules/traits/pages/jvm.adoc index 458b3daf68..a9b1ed4801 100755 --- a/docs/modules/traits/pages/jvm.adoc +++ b/docs/modules/traits/pages/jvm.adoc @@ -17,7 +17,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait jvm.[key]=[value] --trait jvm.[key2]=[value2] integration.groovy +$ kamel run --trait jvm.[key]=[value] --trait jvm.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/kamelets.adoc b/docs/modules/traits/pages/kamelets.adoc index 632790c19d..59e460e07e 100755 --- a/docs/modules/traits/pages/kamelets.adoc +++ b/docs/modules/traits/pages/kamelets.adoc @@ -15,7 +15,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait kamelets.[key]=[value] --trait kamelets.[key2]=[value2] integration.groovy +$ kamel run --trait kamelets.[key]=[value] --trait kamelets.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/keda.adoc b/docs/modules/traits/pages/keda.adoc index 6c41a9ba47..f5bf8ec4e8 100644 --- a/docs/modules/traits/pages/keda.adoc +++ b/docs/modules/traits/pages/keda.adoc @@ -24,7 +24,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait keda.[key]=[value] --trait keda.[key2]=[value2] integration.groovy +$ kamel run --trait keda.[key]=[value] --trait keda.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/knative-service.adoc b/docs/modules/traits/pages/knative-service.adoc index 4449d90dfe..5d8ebbedf6 100755 --- a/docs/modules/traits/pages/knative-service.adoc +++ b/docs/modules/traits/pages/knative-service.adoc @@ -19,7 +19,7 @@ This trait is available in the following profiles: **Knative**. Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait knative-service.[key]=[value] --trait knative-service.[key2]=[value2] integration.groovy +$ kamel run --trait knative-service.[key]=[value] --trait knative-service.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/knative.adoc b/docs/modules/traits/pages/knative.adoc index 5b65347e67..d22f19f07f 100755 --- a/docs/modules/traits/pages/knative.adoc +++ b/docs/modules/traits/pages/knative.adoc @@ -20,7 +20,7 @@ This trait is available in the following profiles: **Knative**. Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait knative.[key]=[value] --trait knative.[key2]=[value2] integration.groovy +$ kamel run --trait knative.[key]=[value] --trait knative.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/logging.adoc b/docs/modules/traits/pages/logging.adoc index 2906c75e29..4191c4de29 100755 --- a/docs/modules/traits/pages/logging.adoc +++ b/docs/modules/traits/pages/logging.adoc @@ -16,7 +16,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait logging.[key]=[value] --trait logging.[key2]=[value2] integration.groovy +$ kamel run --trait logging.[key]=[value] --trait logging.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/master.adoc b/docs/modules/traits/pages/master.adoc index 01a412c0b0..e120f47b21 100755 --- a/docs/modules/traits/pages/master.adoc +++ b/docs/modules/traits/pages/master.adoc @@ -21,7 +21,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait master.[key]=[value] --trait master.[key2]=[value2] integration.groovy +$ kamel run --trait master.[key]=[value] --trait master.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/mount.adoc b/docs/modules/traits/pages/mount.adoc index ba74bfc584..46a0915f5d 100644 --- a/docs/modules/traits/pages/mount.adoc +++ b/docs/modules/traits/pages/mount.adoc @@ -17,7 +17,7 @@ NOTE: The mount trait is a *platform trait* and cannot be disabled by the user. Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait mount.[key]=[value] --trait mount.[key2]=[value2] integration.groovy +$ kamel run --trait mount.[key]=[value] --trait mount.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/openapi.adoc b/docs/modules/traits/pages/openapi.adoc index 6d6de25fc2..f5148671ff 100755 --- a/docs/modules/traits/pages/openapi.adoc +++ b/docs/modules/traits/pages/openapi.adoc @@ -17,7 +17,7 @@ NOTE: The openapi trait is a *platform trait* and cannot be disabled by the user Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait openapi.[key]=[value] --trait openapi.[key2]=[value2] integration.groovy +$ kamel run --trait openapi.[key]=[value] --trait openapi.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/owner.adoc b/docs/modules/traits/pages/owner.adoc index 8ad3805e64..75ff695846 100755 --- a/docs/modules/traits/pages/owner.adoc +++ b/docs/modules/traits/pages/owner.adoc @@ -18,7 +18,7 @@ NOTE: The owner trait is a *platform trait* and cannot be disabled by the user. Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait owner.[key]=[value] --trait owner.[key2]=[value2] integration.groovy +$ kamel run --trait owner.[key]=[value] --trait owner.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/pdb.adoc b/docs/modules/traits/pages/pdb.adoc index b2c3280c74..92da7934f7 100755 --- a/docs/modules/traits/pages/pdb.adoc +++ b/docs/modules/traits/pages/pdb.adoc @@ -15,7 +15,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait pdb.[key]=[value] --trait pdb.[key2]=[value2] integration.groovy +$ kamel run --trait pdb.[key]=[value] --trait pdb.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/platform.adoc b/docs/modules/traits/pages/platform.adoc index 449667d0ce..e9abaac501 100755 --- a/docs/modules/traits/pages/platform.adoc +++ b/docs/modules/traits/pages/platform.adoc @@ -21,7 +21,7 @@ NOTE: The platform trait is a *platform trait* and cannot be disabled by the use Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait platform.[key]=[value] --trait platform.[key2]=[value2] integration.groovy +$ kamel run --trait platform.[key]=[value] --trait platform.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/pod.adoc b/docs/modules/traits/pages/pod.adoc index c87e4f5fac..19593a564b 100755 --- a/docs/modules/traits/pages/pod.adoc +++ b/docs/modules/traits/pages/pod.adoc @@ -19,7 +19,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh [source,console] ---- -$ kamel run integration.groovy --pod-template template.yaml --env TEST_VARIABLE=will_be_overriden --env ANOTHER_VARIABLE=Im_There +$ kamel run integration.yaml --pod-template template.yaml --env TEST_VARIABLE=will_be_overriden --env ANOTHER_VARIABLE=Im_There ---- The value from the template overwrites the `TEST_VARIABLE` environment variable, while `ANOTHER_VARIABLE` stays unchanged. @@ -32,7 +32,7 @@ The value from the template overwrites the `TEST_VARIABLE` environment variable, Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait pod.[key]=[value] integration.groovy +$ kamel run --trait pod.[key]=[value] integration.yaml ---- The following configuration options are available: @@ -52,20 +52,21 @@ The following configuration options are available: With the following Integration, that reads files from a directory: -.integration.groovy -[source,groovy] +[source,yaml] +.pod-trait-route.yaml ---- -from('file:///var/log') - .convertBodyTo(String.class) - .setBody().simple('${body}: {{TEST_VARIABLE}} ') - .log('${body}') - +- from: + uri: "file:///var/log" + steps: + - setBody: + simple: "${body}: {{TEST_VARIABLE}}" + - to: "log:info" ---- Plus the following Pod template, that adds a sidecar container to the Integration Pod, generating some data into the directory, and mounts it into the `integration` container: -.template.yaml [source,yaml] +.pod-trait-template.yaml ---- containers: - name: integration @@ -90,15 +91,13 @@ The Integration route logs the content of the file generated by the sidecar cont [source,console] ---- -$ kamel run integration.groovy --pod-template template.yaml +kamel run pod-trait-route.yaml --pod-template pod-trait-template.yaml ... -Condition "Ready" is "True" for Integration integration -[1] 2021-04-30 07:40:03,136 INFO [route1] (Camel (camel-1) thread #0 - file:///var/log) Fri Apr 30 07:40:02 UTC 2021 Content from the sidecar container -[1] : hello from the template -[1] 2021-04-30 07:40:04,140 INFO [route1] (Camel (camel-1) thread #0 - file:///var/log) Fri Apr 30 07:40:03 UTC 2021 Content from the sidecar container -[1] : hello from the template -[1] 2021-04-30 07:40:05,142 INFO [route1] (Camel (camel-1) thread #0 - file:///var/log) Fri Apr 30 07:40:04 UTC 2021 Content from the sidecar container -[1] : hello from the template +Condition "Ready" is "True" for Integration pod-trait-route: 1/1 ready replicas +Integration "pod-trait-route" in phase "Running" +[1] 2024-05-15 11:32:30,562 INFO [info] (Camel (camel-1) thread #1 - file:///var/log) Exchange[ExchangePattern: InOnly, BodyType: String, Body: Wed May 15 11:32:30 UTC 2024 Content from the sidecar container: hello from the template] +[1] 2024-05-15 11:32:31,574 INFO [info] (Camel (camel-1) thread #1 - file:///var/log) Exchange[ExchangePattern: InOnly, BodyType: String, Body: Wed May 15 11:32:31 UTC 2024 Content from the sidecar container: hello from the template] +[1] 2024-05-15 11:32:32,583 INFO [info] (Camel (camel-1) thread #1 - file:///var/log) Exchange[ExchangePattern: InOnly, BodyType: String, Body: Wed May 15 11:32:32 UTC 2024 Content from the sidecar container: hello from the template] ---- == Init containers diff --git a/docs/modules/traits/pages/prometheus.adoc b/docs/modules/traits/pages/prometheus.adoc index 82d19c075d..ae6aa37745 100755 --- a/docs/modules/traits/pages/prometheus.adoc +++ b/docs/modules/traits/pages/prometheus.adoc @@ -26,7 +26,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait prometheus.[key]=[value] --trait prometheus.[key2]=[value2] integration.groovy +$ kamel run --trait prometheus.[key]=[value] --trait prometheus.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/pull-secret.adoc b/docs/modules/traits/pages/pull-secret.adoc index 8c736917af..9a1b410cf2 100755 --- a/docs/modules/traits/pages/pull-secret.adoc +++ b/docs/modules/traits/pages/pull-secret.adoc @@ -24,7 +24,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait pull-secret.[key]=[value] --trait pull-secret.[key2]=[value2] integration.groovy +$ kamel run --trait pull-secret.[key]=[value] --trait pull-secret.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/quarkus.adoc b/docs/modules/traits/pages/quarkus.adoc index 2531673fc5..1521ed036d 100755 --- a/docs/modules/traits/pages/quarkus.adoc +++ b/docs/modules/traits/pages/quarkus.adoc @@ -23,7 +23,7 @@ NOTE: The quarkus trait is a *platform trait* and cannot be disabled by the user Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait quarkus.[key]=[value] --trait quarkus.[key2]=[value2] integration.groovy +$ kamel run --trait quarkus.[key]=[value] --trait quarkus.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/registry.adoc b/docs/modules/traits/pages/registry.adoc index 2094154954..3043f2d211 100644 --- a/docs/modules/traits/pages/registry.adoc +++ b/docs/modules/traits/pages/registry.adoc @@ -19,7 +19,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait registry.[key]=[value] integration.groovy +$ kamel run --trait registry.[key]=[value] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/resume.adoc b/docs/modules/traits/pages/resume.adoc index 4a5c083525..894fe4d12c 100644 --- a/docs/modules/traits/pages/resume.adoc +++ b/docs/modules/traits/pages/resume.adoc @@ -28,7 +28,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait resume.[key]=[value] --trait resume.[key2]=[value2] integration.groovy +$ kamel run --trait resume.[key]=[value] --trait resume.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/route.adoc b/docs/modules/traits/pages/route.adoc index deb4d0cd45..246d8255bc 100755 --- a/docs/modules/traits/pages/route.adoc +++ b/docs/modules/traits/pages/route.adoc @@ -23,7 +23,7 @@ This trait is available in the following profiles: **OpenShift**. Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait route.[key]=[value] --trait route.[key2]=[value2] integration.groovy +$ kamel run --trait route.[key]=[value] --trait route.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/security-context.adoc b/docs/modules/traits/pages/security-context.adoc index 516dda8047..d53378cafe 100644 --- a/docs/modules/traits/pages/security-context.adoc +++ b/docs/modules/traits/pages/security-context.adoc @@ -17,7 +17,7 @@ NOTE: The security-context trait is a *platform trait* and cannot be disabled by Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait security-context.[key]=[value] --trait security-context.[key2]=[value2] integration.groovy +$ kamel run --trait security-context.[key]=[value] --trait security-context.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/service-binding.adoc b/docs/modules/traits/pages/service-binding.adoc index 9638113acf..73582ad989 100755 --- a/docs/modules/traits/pages/service-binding.adoc +++ b/docs/modules/traits/pages/service-binding.adoc @@ -17,7 +17,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait service-binding.[key]=[value] --trait service-binding.[key2]=[value2] integration.groovy +$ kamel run --trait service-binding.[key]=[value] --trait service-binding.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/service.adoc b/docs/modules/traits/pages/service.adoc index 14c59f7c21..97bb436acf 100755 --- a/docs/modules/traits/pages/service.adoc +++ b/docs/modules/traits/pages/service.adoc @@ -18,7 +18,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait service.[key]=[value] --trait service.[key2]=[value2] integration.groovy +$ kamel run --trait service.[key]=[value] --trait service.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/telemetry.adoc b/docs/modules/traits/pages/telemetry.adoc index 18945f57b6..44f54204e7 100644 --- a/docs/modules/traits/pages/telemetry.adoc +++ b/docs/modules/traits/pages/telemetry.adoc @@ -21,7 +21,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait telemetry.[key]=[value] --trait telemetry.[key2]=[value2] integration.groovy +$ kamel run --trait telemetry.[key]=[value] --trait telemetry.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/toleration.adoc b/docs/modules/traits/pages/toleration.adoc index 9b5bb18640..ac8aa68331 100755 --- a/docs/modules/traits/pages/toleration.adoc +++ b/docs/modules/traits/pages/toleration.adoc @@ -26,7 +26,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait toleration.[key]=[value] --trait toleration.[key2]=[value2] integration.groovy +$ kamel run --trait toleration.[key]=[value] --trait toleration.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/tracing.adoc b/docs/modules/traits/pages/tracing.adoc index 1b25ba1943..26d638f8eb 100644 --- a/docs/modules/traits/pages/tracing.adoc +++ b/docs/modules/traits/pages/tracing.adoc @@ -24,7 +24,7 @@ This trait is available in the following profiles: **Kubernetes, Knative, OpenSh Trait properties can be specified when running any integration with the CLI: [source,console] ---- -$ kamel run --trait tracing.[key]=[value] --trait tracing.[key2]=[value2] integration.groovy +$ kamel run --trait tracing.[key]=[value] --trait tracing.[key2]=[value2] integration.yaml ---- The following configuration options are available: diff --git a/docs/modules/traits/pages/traits.adoc b/docs/modules/traits/pages/traits.adoc index 1f21359966..cbf1d23631 100644 --- a/docs/modules/traits/pages/traits.adoc +++ b/docs/modules/traits/pages/traits.adoc @@ -15,9 +15,10 @@ Each trait has a unique ID that can be used to configure it using the command li E.g. in order to disable the creation of a Service for a integration, a user can execute: -``` -kamel run --trait service.enabled=false file.groovy -``` +[source] +---- +kamel run --trait service.enabled=false file.yaml +---- The flag `--trait` can be also abbreviated with `-t`.