You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2020/09/27 07:41:18 UTC

[camel-k] 01/02: docs: add section describing secret ref in properties files

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

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

commit abe76dab72338613535c079a3e1ce0bbc0034e05
Author: Evan Shortiss <ev...@gmail.com>
AuthorDate: Sat Sep 26 12:35:54 2020 +0100

    docs: add section describing secret ref in properties files
---
 .../ROOT/pages/configuration/configmap-secret.adoc | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/docs/modules/ROOT/pages/configuration/configmap-secret.adoc b/docs/modules/ROOT/pages/configuration/configmap-secret.adoc
index 1be9f30..6ed5ec6 100644
--- a/docs/modules/ROOT/pages/configuration/configmap-secret.adoc
+++ b/docs/modules/ROOT/pages/configuration/configmap-secret.adoc
@@ -77,3 +77,43 @@ You can now run the integration with the following command to reference the _Sec
 ```
 kamel run --secret=my-secret props.groovy
 ```
+
+== Reference a Secret in Properties
+
+Suppose you have an existing _Secret_ that contains sensitive information that your integration requires. You might want to reference the values from this _Secret_ in your configuration properties.
+
+For example, a _Secret_ named *secret-message*:
+
+[source,yaml]
+.secret-message.yaml
+----
+apiVersion: v1
+kind: Secret
+metadata:
+  name: secret-message
+data:
+  MESSAGE: SGVsbG8gV29ybGQK
+type: Opaque
+----
+
+You can reference this _Secret_ in configuration properties using the `{{secret:secret-name/key-name}}` syntax.
+
+For example, the following configuration stored in a _ConfigMap_ references the example _Secret_ defined previously:
+
+[source,yaml]
+.my-config.yaml
+----
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: my-config
+data:
+  application.properties: |
+    my.message=={{secret:secret-message/MESSAGE}}
+----
+
+You can now run the integration with the following command to include necessary the _Secret_ and _ConfigMap_:
+
+```
+kamel run --secret=secret-message --configmap=my-config props.groovy
+```
\ No newline at end of file