You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/08/02 06:33:01 UTC

[camel-k-examples] branch main updated (4324d4c -> ee1053c)

This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git


    from 4324d4c  Property brokers renamed for Kafka Kamelet
     new 098fbd4  feat(config): Update user configuration examples
     new 46bbfec  feat(config): Add kamelets configuration examples
     new ee1053c  chore(pipe): Add Pipe to KameletBinding reference

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 generic-examples/kamelets/README.md                |  17 +-
 .../kamelets/user-config/application.properties    |   2 +
 .../kamelets/user-config/config.properties         |   3 +
 .../kamelets-pipe-embedded-parameters-2.yaml}      |  22 ++-
 .../kamelets-pipe-embedded-parameters.yaml}        |  26 ++-
 .../kamelets-pipe-secret-parameters-2.yaml}        |  22 ++-
 .../kamelets-pipe-secret-parameters-3.yaml}        |  18 +-
 .../kamelets-pipe-secret-parameters.yaml}          |  25 ++-
 .../kamelets-route-embedded-parameters-2.yaml}     |  45 ++---
 .../kamelets-route-embedded-parameters.yaml}       |  32 ++--
 .../kamelets-route-secret-parameters-2.yaml}       |  29 +--
 .../kamelets-route-secret-parameters.yaml}         |  31 ++--
 .../kamelets/user-config/log-sink.properties       |   1 +
 generic-examples/kamelets/user-config/readme.md    | 200 +++++++++++++++++++++
 .../kamelets/user-config/timer-source.properties   |   1 +
 generic-examples/user-config/README.md             |  59 +++++-
 16 files changed, 414 insertions(+), 119 deletions(-)
 create mode 100644 generic-examples/kamelets/user-config/application.properties
 create mode 100644 generic-examples/kamelets/user-config/config.properties
 copy generic-examples/kamelets/{timer-source/kamelet-binding-example.yaml => user-config/kamelets-pipe-embedded-parameters-2.yaml} (71%)
 copy generic-examples/kamelets/{timer-source/kamelet-binding-example.yaml => user-config/kamelets-pipe-embedded-parameters.yaml} (70%)
 copy generic-examples/kamelets/{timer-source/kamelet-binding-example.yaml => user-config/kamelets-pipe-secret-parameters-2.yaml} (75%)
 copy generic-examples/kamelets/{timer-source-log-sink/timer-source.binding.yaml => user-config/kamelets-pipe-secret-parameters-3.yaml} (76%)
 copy generic-examples/kamelets/{timer-source/kamelet-binding-example.yaml => user-config/kamelets-pipe-secret-parameters.yaml} (73%)
 copy generic-examples/{databases/postgres-deploy/postgres-storage.yaml => kamelets/user-config/kamelets-route-embedded-parameters-2.yaml} (62%)
 copy generic-examples/kamelets/{error-handler/log-sink.kamelet.yaml => user-config/kamelets-route-embedded-parameters.yaml} (67%)
 copy generic-examples/kamelets/{error-handler/log-sink.kamelet.yaml => user-config/kamelets-route-secret-parameters-2.yaml} (71%)
 copy generic-examples/kamelets/{error-handler/log-sink.kamelet.yaml => user-config/kamelets-route-secret-parameters.yaml} (69%)
 create mode 100644 generic-examples/kamelets/user-config/log-sink.properties
 create mode 100644 generic-examples/kamelets/user-config/readme.md
 create mode 100644 generic-examples/kamelets/user-config/timer-source.properties


[camel-k-examples] 02/03: feat(config): Add kamelets configuration examples

Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git

commit 46bbfecce903177c4bd0e4185d41d22b23d5d229
Author: Gaelle Fournier <ga...@gmail.com>
AuthorDate: Mon Jul 31 17:25:33 2023 +0200

    feat(config): Add kamelets configuration examples
---
 generic-examples/kamelets/README.md                |   5 +-
 .../kamelets/user-config/application.properties    |   2 +
 .../kamelets/user-config/config.properties         |   3 +
 .../kamelets-pipe-embedded-parameters-2.yaml       |  38 ++++
 .../kamelets-pipe-embedded-parameters.yaml         |  42 +++++
 .../kamelets-pipe-secret-parameters-2.yaml         |  38 ++++
 .../kamelets-pipe-secret-parameters-3.yaml         |  34 ++++
 .../kamelets-pipe-secret-parameters.yaml           |  41 +++++
 .../kamelets-route-embedded-parameters-2.yaml      |  37 ++++
 .../kamelets-route-embedded-parameters.yaml        |  38 ++++
 .../kamelets-route-secret-parameters-2.yaml        |  35 ++++
 .../kamelets-route-secret-parameters.yaml          |  37 ++++
 .../kamelets/user-config/log-sink.properties       |   1 +
 generic-examples/kamelets/user-config/readme.md    | 200 +++++++++++++++++++++
 .../kamelets/user-config/timer-source.properties   |   1 +
 15 files changed, 551 insertions(+), 1 deletion(-)

diff --git a/generic-examples/kamelets/README.md b/generic-examples/kamelets/README.md
index f0f2a5c..51686ee 100644
--- a/generic-examples/kamelets/README.md
+++ b/generic-examples/kamelets/README.md
@@ -26,4 +26,7 @@ The examples are grouped into the following sub-directories:
 - [timer-source-log-sink](./timer-source-log-sink/): 
     - create and use a timer source kamelet
     - bind a source kamelet to a Knative destination using KamletBinding
-    - create a log sink kamlet and bind it to the Knative destination using KamletBinding
\ No newline at end of file
+    - create a log sink kamlet and bind it to the Knative destination using KamletBinding
+- [user-config](./user-config/): contains examples on how to:
+    - configure from Properties or Secrets an Integration using Kamelets
+    - configure from Properties or Secrets a Pipe/KameletBinding
\ No newline at end of file
diff --git a/generic-examples/kamelets/user-config/application.properties b/generic-examples/kamelets/user-config/application.properties
new file mode 100644
index 0000000..b54851c
--- /dev/null
+++ b/generic-examples/kamelets/user-config/application.properties
@@ -0,0 +1,2 @@
+my-message=Property secret
+my-logger=PropertySecretLogger
\ No newline at end of file
diff --git a/generic-examples/kamelets/user-config/config.properties b/generic-examples/kamelets/user-config/config.properties
new file mode 100644
index 0000000..4f7eb9e
--- /dev/null
+++ b/generic-examples/kamelets/user-config/config.properties
@@ -0,0 +1,3 @@
+camel.kamelet.timer-source.myconfig.message=My config secret
+camel.kamelet.log-sink.mylogconfig.loggerName=SecretLogger
+camel.kamelet.log-sink.myotherlogconfig.loggerName=SecretOtherLogger
\ No newline at end of file
diff --git a/generic-examples/kamelets/user-config/kamelets-pipe-embedded-parameters-2.yaml b/generic-examples/kamelets/user-config/kamelets-pipe-embedded-parameters-2.yaml
new file mode 100644
index 0000000..e0c1913
--- /dev/null
+++ b/generic-examples/kamelets/user-config/kamelets-pipe-embedded-parameters-2.yaml
@@ -0,0 +1,38 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1
+kind: Pipe
+metadata:
+  name: kamelets-pipe-embedded-parameters-2
+spec:
+  integration:
+    configuration:
+    - type: "property"
+      value: "camel.kamelet.timer-source.source.message=My message"
+    - type: "property"
+      value: "camel.kamelet.log-sink.sink.loggerName=mylog"
+  source:
+    ref:
+      apiVersion: camel.apache.org/v1
+      kind: Kamelet
+      name: timer-source
+  sink:
+    ref:
+      apiVersion: camel.apache.org/v1
+      kind: Kamelet
+      name: log-sink
diff --git a/generic-examples/kamelets/user-config/kamelets-pipe-embedded-parameters.yaml b/generic-examples/kamelets/user-config/kamelets-pipe-embedded-parameters.yaml
new file mode 100644
index 0000000..4ef5570
--- /dev/null
+++ b/generic-examples/kamelets/user-config/kamelets-pipe-embedded-parameters.yaml
@@ -0,0 +1,42 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1
+kind: Pipe
+metadata:
+  name: kamelets-pipe-embedded-parameters
+spec:
+  integration:
+    configuration:
+    - type: "property"
+      value: "my-message=embedded message"
+    - type: "property"
+      value: "my-logger=embeddedlog"
+  source:
+    properties:
+      message: "{{my-message}}"
+    ref:
+      apiVersion: camel.apache.org/v1
+      kind: Kamelet
+      name: timer-source
+  sink:
+    properties:
+      loggerName: "{{my-logger}}"
+    ref:
+      apiVersion: camel.apache.org/v1
+      kind: Kamelet
+      name: log-sink
diff --git a/generic-examples/kamelets/user-config/kamelets-pipe-secret-parameters-2.yaml b/generic-examples/kamelets/user-config/kamelets-pipe-secret-parameters-2.yaml
new file mode 100644
index 0000000..735d7b4
--- /dev/null
+++ b/generic-examples/kamelets/user-config/kamelets-pipe-secret-parameters-2.yaml
@@ -0,0 +1,38 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1
+kind: Pipe
+metadata:
+  name: kamelets-pipe-secret-parameters-2
+spec:
+  integration:
+    traits:
+      mount:
+        configs:
+        - secret:my-timer-source-secret
+        - secret:my-log-sink-secret
+  source:
+    ref:
+      apiVersion: camel.apache.org/v1
+      kind: Kamelet
+      name: timer-source
+  sink:
+    ref:
+      apiVersion: camel.apache.org/v1
+      kind: Kamelet
+      name: log-sink
diff --git a/generic-examples/kamelets/user-config/kamelets-pipe-secret-parameters-3.yaml b/generic-examples/kamelets/user-config/kamelets-pipe-secret-parameters-3.yaml
new file mode 100644
index 0000000..230891d
--- /dev/null
+++ b/generic-examples/kamelets/user-config/kamelets-pipe-secret-parameters-3.yaml
@@ -0,0 +1,34 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1
+kind: Pipe
+metadata:
+  name: kamelets-pipe-secret-parameters-3
+  annotations:
+    trait.camel.apache.org/mount.configs: '["secret:my-timer-source-secret","secret:my-log-sink-secret"]'
+spec:
+  source:
+    ref:
+      apiVersion: camel.apache.org/v1
+      kind: Kamelet
+      name: timer-source
+  sink:
+    ref:
+      apiVersion: camel.apache.org/v1
+      kind: Kamelet
+      name: log-sink
diff --git a/generic-examples/kamelets/user-config/kamelets-pipe-secret-parameters.yaml b/generic-examples/kamelets/user-config/kamelets-pipe-secret-parameters.yaml
new file mode 100644
index 0000000..1d11740
--- /dev/null
+++ b/generic-examples/kamelets/user-config/kamelets-pipe-secret-parameters.yaml
@@ -0,0 +1,41 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1
+kind: Pipe
+metadata:
+  name: kamelets-pipe-secret-parameters
+spec:
+  integration:
+    traits:
+      mount:
+        configs:
+        - secret:my-pipe-secret
+  source:
+    properties:
+      message: "{{my-message}}"
+    ref:
+      apiVersion: camel.apache.org/v1
+      kind: Kamelet
+      name: timer-source
+  sink:
+    properties:
+      loggerName: "{{my-logger}}"
+    ref:
+      apiVersion: camel.apache.org/v1
+      kind: Kamelet
+      name: log-sink
diff --git a/generic-examples/kamelets/user-config/kamelets-route-embedded-parameters-2.yaml b/generic-examples/kamelets/user-config/kamelets-route-embedded-parameters-2.yaml
new file mode 100644
index 0000000..f309a84
--- /dev/null
+++ b/generic-examples/kamelets/user-config/kamelets-route-embedded-parameters-2.yaml
@@ -0,0 +1,37 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1
+kind: Integration
+metadata:
+  name: kamelets-route-embedded-parameters-2
+spec:
+  traits:
+    camel:
+      properties:
+      - camel.kamelet.timer-source.myconfig.message = My Config message
+      - camel.kamelet.log-sink.mylogconfig.loggerName = myconfiglog
+      - camel.kamelet.log-sink.myotherlogconfig.loggerName = myotherconfiglog
+  flows:
+  - route:
+      from:
+        uri: kamelet:timer-source/myconfig
+        steps:
+        - to:
+            uri: kamelet:log-sink/mylogconfig
+        - to:
+            uri: kamelet:log-sink/myotherlogconfig
diff --git a/generic-examples/kamelets/user-config/kamelets-route-embedded-parameters.yaml b/generic-examples/kamelets/user-config/kamelets-route-embedded-parameters.yaml
new file mode 100644
index 0000000..bf55f79
--- /dev/null
+++ b/generic-examples/kamelets/user-config/kamelets-route-embedded-parameters.yaml
@@ -0,0 +1,38 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1
+kind: Integration
+metadata:
+  name: kamelets-route-embedded-parameters
+spec:
+  traits:
+    camel:
+      properties:
+      - my-message = embedded message
+      - my-logger = embeddedlog
+  flows:
+  - route:
+      from:
+        uri: kamelet:timer-source
+        parameters:
+          message: '{{my-message}}'
+        steps:
+        - to:
+            uri: kamelet:log-sink
+            parameters:
+              loggerName: '{{my-logger}}'
\ No newline at end of file
diff --git a/generic-examples/kamelets/user-config/kamelets-route-secret-parameters-2.yaml b/generic-examples/kamelets/user-config/kamelets-route-secret-parameters-2.yaml
new file mode 100644
index 0000000..247ebd2
--- /dev/null
+++ b/generic-examples/kamelets/user-config/kamelets-route-secret-parameters-2.yaml
@@ -0,0 +1,35 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1
+kind: Integration
+metadata:
+  name: kamelets-route-secret-parameters-2
+spec:
+  traits:
+    mount:
+      configs:
+      - secret:my-kamelets-secret-2
+  flows:
+  - route:
+      from:
+        uri: kamelet:timer-source/myconfig
+        steps:
+        - to:
+            uri: kamelet:log-sink/mylogconfig
+        - to:
+            uri: kamelet:log-sink/myotherlogconfig
diff --git a/generic-examples/kamelets/user-config/kamelets-route-secret-parameters.yaml b/generic-examples/kamelets/user-config/kamelets-route-secret-parameters.yaml
new file mode 100644
index 0000000..02d39ed
--- /dev/null
+++ b/generic-examples/kamelets/user-config/kamelets-route-secret-parameters.yaml
@@ -0,0 +1,37 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1
+kind: Integration
+metadata:
+  name: kamelets-route-secret-parameters
+spec:
+  traits:
+    mount:
+      configs:
+      - secret:my-kamelets-secret
+  flows:
+  - route:
+      from:
+        uri: kamelet:timer-source
+        parameters:
+          message: '{{my-message}}'
+        steps:
+        - to:
+            uri: kamelet:log-sink
+            parameters:
+              loggerName: '{{my-logger}}'
diff --git a/generic-examples/kamelets/user-config/log-sink.properties b/generic-examples/kamelets/user-config/log-sink.properties
new file mode 100644
index 0000000..b5b737b
--- /dev/null
+++ b/generic-examples/kamelets/user-config/log-sink.properties
@@ -0,0 +1 @@
+camel.kamelet.log-sink.loggerName=SecretLogger
\ No newline at end of file
diff --git a/generic-examples/kamelets/user-config/readme.md b/generic-examples/kamelets/user-config/readme.md
new file mode 100644
index 0000000..d4a3259
--- /dev/null
+++ b/generic-examples/kamelets/user-config/readme.md
@@ -0,0 +1,200 @@
+# User Config
+
+This example shows how you can configure applications built on Kamelets as Integrations or Pipes/KameletBindings. The Integrations and Pipes are provided as Kubernetes Custom Resource and make no use of the `kamel` CLI.
+
+This example uses use out of the box Kamelets Timer Source and Log Sink.
+
+## Integrations using Kamelets
+
+You have multiple options when using parameters in your integrations.
+
+### Basic usage parameters
+
+1. `camel` trait
+
+You can define your kamelets parameters by adding them directly inside you integration using the `camel` trait.
+
+Run the following command to create your [integration](./kamelets-route-embedded-parameters.yaml):
+```
+$ kubectl apply -f kamelets-route-embedded-parameters.yaml
+```
+
+After a while you will be able to watch your logs:
+```
+$ kubectl logs -l camel.apache.org/integration=kamelets-route-embedded-parameters
+
+2023-08-01 08:18:35,119 INFO  [embeddedlog] (Camel (camel-1) thread #1 - timer://tick) Exchange[ExchangePattern: InOnly, BodyType: String, Body: embedded message]
+```
+
+2. Kubernetes Secret and `mount` trait
+
+You can define your kamelets parameters by declaring them in a kubernetes secret and binding them to your integration using the `mount` trait.
+
+Run the following command to create the secret related containing your parameters values:
+```
+$ kubectl create secret generic my-kamelets-secret --from-file=application.properties
+```
+
+Run the following command to create your [integration](./kamelets-route-secret-parameters.yaml):
+```
+$ kubectl apply -f kamelets-route-secret-parameters.yaml
+```
+
+After a while you will be able to watch your logs:
+```
+$ kubectl logs -l camel.apache.org/integration=kamelets-route-embedded-parameters
+
+2023-08-01 08:36:11,084 INFO  [PropertySecretLogger] (Camel (camel-1) thread #1 - timer://tick) Exchange[ExchangePattern: InOnly, BodyType: String, Body: Property secret]
+```
+
+### Named configuration
+
+The usage of a named configuration allows for different properties for the separate usages of the same kamelet in an integration.
+
+1. `camel` trait
+
+You can use named configuration with the `camel` trait to allow different configuration for the same kamelet.
+
+Run the following command to create your [integration](./kamelets-route-embedded-parameters-2.yaml):
+```
+$ kubectl apply -f kamelets-route-embedded-parameters-2.yaml
+```
+
+After a while you will be able to watch your logs with the 2 loggers:
+```
+$ kubectl logs -l camel.apache.org/integration=kamelets-route-embedded-parameters-2
+
+2023-08-01 09:17:28,818 INFO  [myconfiglog] (Camel (camel-1) thread #1 - timer://tick) Exchange[ExchangePattern: InOnly, BodyType: String, Body: My Config message]
+2023-08-01 09:17:28,819 INFO  [myotherconfiglog] (Camel (camel-1) thread #1 - timer://tick) Exchange[ExchangePattern: InOnly, BodyType: String, Body: My Config message]
+```
+
+2. Kubernetes Secret and `mount` trait
+
+You can define your kamelets parameters by declaring them in a kubernetes secret and binding them to your integration using the `mount` trait.
+
+Run the following command to create the secret related containing your parameters values:
+```
+$ kubectl create secret generic my-kamelets-secret-2 --from-file=config.properties
+```
+
+Run the following command to create your [integration](./kamelets-route-secret-parameters-2.yaml):
+```
+$ kubectl apply -f kamelets-route-secret-parameters-2.yaml
+```
+
+After a while you will be able to watch your logs with the 2 loggers:
+```
+$ kubectl logs -l camel.apache.org/integration=kamelets-route-embedded-parameters
+
+2023-08-01 09:44:38,824 INFO  [SecretLogger] (Camel (camel-1) thread #1 - timer://tick) Exchange[ExchangePattern: InOnly, BodyType: String, Body: My config secret]
+2023-08-01 09:44:38,824 INFO  [SecretOtherLogger] (Camel (camel-1) thread #1 - timer://tick) Exchange[ExchangePattern: InOnly, BodyType: String, Body: My config secret]
+```
+
+
+## Pipes/KameletBindings
+
+Pipes allow using the same declarative style of binding  to connect to various sources/sinks kamelets. The way to configure them is slightly different from Integrations.
+
+
+### Basic usage parameters
+
+1. Pipe integration configuration
+
+You can define your kamelets parameters by adding them directly inside you integration using the `.spec.integration.configuration` object with type `property`.
+
+Run the following command to create your [integration](./kamelets-pipe-embedded-parameters.yaml):
+```
+$ kubectl apply -f kamelets-pipe-embedded-parameters.yaml
+```
+
+After a while you will be able to watch your logs:
+```
+$ kubectl logs -l camel.apache.org/integration=kamelets-pipe-embedded-parameters
+
+2023-08-01 12:20:36,168 INFO  [embeddedlog] (Camel (camel-1) thread #1 - timer://tick) Exchange[ExchangePattern: InOnly, BodyType: String, Body: embedded message]
+```
+
+2. Kubernetes Secret and `mount` trait
+
+You can define your kamelets parameters by declaring them in a kubernetes secret and binding them to your integration using the `mount` trait.
+
+Run the following command to create the secret related containing your parameters values:
+```
+$ kubectl create secret generic my-pipe-secret --from-file=application.properties
+```
+
+Run the following command to create your [integration](./kamelets-route-secret-parameters.yaml):
+```
+$ kubectl apply -f kamelets-route-secret-parameters.yaml
+```
+
+After a while you will be able to watch your logs:
+```
+$ kubectl logs -l camel.apache.org/integration=kamelets-pipe-secret-parameters
+
+2023-08-01 08:36:11,084 INFO  [PropertySecretLogger] (Camel (camel-1) thread #1 - timer://tick) Exchange[ExchangePattern: InOnly, BodyType: String, Body: Property secret]
+```
+
+### Implicit configuration
+
+This is a case when you inject your properties without refering them on the kamelet declaration.
+
+1. Pipe integration configuration
+
+You can define your kamelets parameters by adding them directly inside you integration using the `.spec.integration.configuration` object with type `property`. This version uses the default property name.
+
+Run the following command to create your [pipe](./kamelets-pipe-embedded-parameters.yaml):
+```
+$ kubectl apply -f kamelets-pipe-embedded-parameters.yaml
+```
+
+After a while you will be able to watch your logs:
+```
+$ kubectl logs -l camel.apache.org/integration=kamelets-pipe-embedded-parameters
+
+2023-08-01 15:38:04,919 INFO  [embeddedlog] (Camel (camel-1) thread #1 - timer://tick) Exchange[ExchangePattern: InOnly, BodyType: String, Body: embedded message]
+```
+
+2. Kubernetes Secret and `mount` trait
+
+You can define your kamelets parameters by declaring them in a kubernetes secret and binding them to your integration using the `mount` trait.
+
+Run the following commands to create the secrets related containing your default parameters values:
+```
+$ kubectl create secret generic my-timer-source-secret --from-file=timer-source.properties
+$ kubectl create secret generic my-log-sink-secret --from-file=log-sink.properties
+```
+
+Run the following command to create your [pipe](./kamelets-pipe-secret-parameters-2.yaml):
+```
+$ kubectl apply -f kamelets-pipe-secret-parameters-2.yaml
+```
+
+After a while you will be able to watch your logs:
+```
+$ kubectl logs -l camel.apache.org/integration=kamelets-pipe-secret-parameters-2
+
+2023-08-01 15:39:50,124 INFO  [SecretLogger] (Camel (camel-1) thread #1 - timer://tick) Exchange[ExchangePattern: InOnly, BodyType: String, Body: My secret]
+```
+
+The `mount` trait can also be declared as an annotation.
+
+Run the following command to create your [pipe](./kamelets-pipe-secret-parameters-3.yaml):
+```
+$ kubectl apply -f kamelets-pipe-secret-parameters-3.yaml
+```
+
+After a while you will be able to watch your logs:
+```
+$ kubectl logs -l camel.apache.org/integration=kamelets-pipe-secret-parameters-3
+
+2023-08-01 15:40:24,266 INFO  [SecretLogger] (Camel (camel-1) thread #1 - timer://tick) Exchange[ExchangePattern: InOnly, BodyType: String, Body: My secret]
+```
+
+## Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please see the [community support page](https://camel.apache.org/community/support/) and let us know.
+
+We also love contributors, so [get involved](https://camel.apache.org/community/contributing/) :-)
+
+The Camel riders!
\ No newline at end of file
diff --git a/generic-examples/kamelets/user-config/timer-source.properties b/generic-examples/kamelets/user-config/timer-source.properties
new file mode 100644
index 0000000..565560a
--- /dev/null
+++ b/generic-examples/kamelets/user-config/timer-source.properties
@@ -0,0 +1 @@
+camel.kamelet.timer-source.message=My secret
\ No newline at end of file


[camel-k-examples] 01/03: feat(config): Update user configuration examples

Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git

commit 098fbd48e572eead503e9a1a7005d9eff6e38d16
Author: Gaelle Fournier <ga...@gmail.com>
AuthorDate: Mon Jul 31 16:52:29 2023 +0200

    feat(config): Update user configuration examples
---
 generic-examples/user-config/README.md | 59 +++++++++++++++++++++++++++++++++-
 1 file changed, 58 insertions(+), 1 deletion(-)

diff --git a/generic-examples/user-config/README.md b/generic-examples/user-config/README.md
index 4af0fd8..261c77b 100644
--- a/generic-examples/user-config/README.md
+++ b/generic-examples/user-config/README.md
@@ -1,3 +1,60 @@
 # Camel K user configuration examples
 
-Find useful examples about how to include a configuration property or a configuration file in Camel K.
\ No newline at end of file
+Find useful examples about how to include a configuration property or a configuration file in Camel K.
+
+These examples use the Camel-k CLI `kamel run ...` command.
+
+## Configuration properties
+
+These examples show the different  ways you can **properties** to configure integrations.
+
+* provide build time properties with `--build-property`
+  * `build-property-route.groovy`
+  * `build-property-file-route.groovy`
+
+* provide runtime properties with `-p`
+  * `property-file-route.groovy`
+  * `property-route.groovy`
+
+## Configuration Configmap
+
+These examples show the different ways you can use **ConfigMaps** to configure integrations.
+
+* provide properties from a configmap with `--config`
+  * `config-configmap-route.groovy`
+
+* provide properties from a configmap with `--resource`
+  * `resource-configmap-route.groovy`
+  * `resource-configmap-location-route.groovy`
+  * `resource-configmap-key-location-route.groovy`
+
+## Configuration Secret
+
+These examples show the different ways you can use **Secrets** to configure integrations.
+
+* provide properties from a secret with `--config`
+* `config-secret-route.groovy`
+* `config-secret-property-route.groovy`
+* `config-secret-key-route.groovy`
+
+* provide properties from a secret with `--resource`
+* `resource-secret-route.groovy`
+* `resource-secret-location-route.groovy`
+
+
+
+## Configuration Resource file (Camel-K <= 1.12.1)
+
+**These examples only work with a version of  Camel-K <= 1.12.1**
+
+These examples show the different ways you can use **resource files** to configure integrations.
+
+* provide properties from a resource file with `--config`
+  * `config-file-route.groovy`
+
+* provide properties from a resource file with `--resource`
+* `resource-file-route.groovy`
+* `resource-file-location-route.groovy`
+* `resource-file-binary-route.groovy`
+* `resource-file-base64-route.groovy`
+```


[camel-k-examples] 03/03: chore(pipe): Add Pipe to KameletBinding reference

Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git

commit ee1053cbbabe3dcd8355cff5756bc5f2a0e24609
Author: Gaelle Fournier <ga...@gmail.com>
AuthorDate: Tue Aug 1 18:08:04 2023 +0200

    chore(pipe): Add Pipe to KameletBinding reference
---
 generic-examples/kamelets/README.md | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/generic-examples/kamelets/README.md b/generic-examples/kamelets/README.md
index 51686ee..cb5852e 100644
--- a/generic-examples/kamelets/README.md
+++ b/generic-examples/kamelets/README.md
@@ -17,16 +17,16 @@ The examples are grouped into the following sub-directories:
 - [chuck-norris](./chuck-norris/): contains quick demonstration on how to use an already existing kamelet in a Camel application.
 - [error-handler](./error-handler/): contains examples on how to:
     - create event source kamelet and sink kamelet
-    - bind the source and sink kamelets using KameletBinding
+    - bind the source and sink kamelets using Pipe/KameletBinding
     - handle error arising from sending events
-- [kameletbindings](./kameletbindings/): contains more examples on KamletBindings and how to use `traits` to customize your integration.
-- [timer-source](./timer-source/): contains examples on how to: 
+- [pipes/kameletbindings](./kameletbindings/): contains more examples on Pipe/KameletBinding and how to use `traits` to customize your integration.
+- [timer-source](./timer-source/): contains examples on how to:
     - create and use a timer source kamelet
-    - bind a source kamelet to a Knative destination using KamletBinding
-- [timer-source-log-sink](./timer-source-log-sink/): 
+    - bind a source kamelet to a Knative destination using Pipe/KameletBinding
+- [timer-source-log-sink](./timer-source-log-sink/):
     - create and use a timer source kamelet
-    - bind a source kamelet to a Knative destination using KamletBinding
-    - create a log sink kamlet and bind it to the Knative destination using KamletBinding
+    - bind a source kamelet to a Knative destination using Pipe/KameletBinding
+    - create a log sink kamelet and bind it to the Knative destination using Pipe/KameletBinding
 - [user-config](./user-config/): contains examples on how to:
     - configure from Properties or Secrets an Integration using Kamelets
     - configure from Properties or Secrets a Pipe/KameletBinding
\ No newline at end of file