You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2021/02/08 08:36:30 UTC
[camel-k] 03/03: chore(doc): Polish configuration via ConfigMap and
Secret documentation
This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 4a31f965dcf0da1e1a500357c5a193f00e57cbf1
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Thu Feb 4 19:07:54 2021 +0100
chore(doc): Polish configuration via ConfigMap and Secret documentation
---
.../ROOT/pages/configuration/configmap-secret.adoc | 79 ++++++++++++----------
1 file changed, 43 insertions(+), 36 deletions(-)
diff --git a/docs/modules/ROOT/pages/configuration/configmap-secret.adoc b/docs/modules/ROOT/pages/configuration/configmap-secret.adoc
index fabc9af..9748b5c 100644
--- a/docs/modules/ROOT/pages/configuration/configmap-secret.adoc
+++ b/docs/modules/ROOT/pages/configuration/configmap-secret.adoc
@@ -1,8 +1,8 @@
= Configuration via ConfigMap or Secret
-Camel K allows to define property values using Kubernetes ConfigMap or Secrets.
+Camel K allows defining property values using Kubernetes ConfigMap or Secrets.
-For the sake of simplicity, consider the following integration:
+For the sake of example, consider the following integration:
[source,groovy]
.props.groovy
@@ -11,13 +11,13 @@ from('timer:props?period=1000')
.log('{{my.message}}')
----
-In addition to xref:configuration/configuration.adoc[command line property configuration], Camel K provides the following options.
+In addition to xref:configuration/configuration.adoc[command line property configuration], Camel K provides the following configuration mechanisms.
== Configuration via ConfigMap
-You can create a _ConfigMap_ containing your configuration properties and link it to a Camel K integration.
+You can create a ConfigMap containing your configuration properties, and link it to a Camel K integration.
-For example, you can define the following _ConfigMap_:
+For example, you can define the following ConfigMap:
[source,yaml]
.my-config.yaml
@@ -32,26 +32,29 @@ data:
logging.level.org.apache.camel=DEBUG
----
-In the _ConfigMap_ above we've set both the value of the `my.message` property and also the xref:configuration/logging.adoc[logging level] for the `org.apache.camel` package.
+In the ConfigMap above, we've set both the value of the property `my.message`, and also the xref:configuration/logging.adoc[logging level] for the `org.apache.camel` package.
-You need to create the _ConfigMap_ first (in the same Kubernetes namespace):
+You need to create the ConfigMap first (in the same Kubernetes namespace):
-```
-kubectl apply -f my-config.yaml
-```
+[source,console]
+----
+$ kubectl apply -f my-config.yaml
+----
-You can now run the integration with the following command to reference the _ConfigMap_:
+You can now run the integration with the following command to reference the ConfigMap:
-```
-kamel run --configmap=my-config props.groovy
-```
+[source, console]
+----
+$ kamel run --configmap=my-config props.groovy
+----
== Configuration via Secret
-Configuration via _Secrets_ is similar to the configuration via _ConfigMap_. The difference is that you may need to `base64` encode the content of the
-`application.properties` file inside the secret.
+Configuration via a Secret is similar to the configuration via a ConfigMap.
+The difference is that you may need to _base64_ encode the content of the
+`application.properties` file inside the Secret.
-For example, the following _Secret_ is equivalent to the previous _ConfigMap_:
+For example, the following Secret is equivalent to the previous ConfigMap:
[source,yaml]
.my-secret.yaml
@@ -66,23 +69,26 @@ data:
PURFQlVHCg==
----
-You need to create the _Secret_ first (in the same Kubernetes namespace):
+You need to create the Secret first (in the same Kubernetes namespace):
-```
-kubectl apply -f my-secret.yaml
-```
+[source, console]
+----
+$ kubectl apply -f my-secret.yaml
+----
-You can now run the integration with the following command to reference the _Secret_:
+You can now run the integration with the following command to reference the Secret:
-```
-kamel run --secret=my-secret props.groovy
-```
+[source,console]
+----
+$ kamel run --secret=my-secret props.groovy
+----
-== Reference a Secret in Properties
+== Reference a Secret from 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.
+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*:
+For example, a Secret named `secret-message`:
[source,yaml]
.secret-message.yaml
@@ -96,9 +102,9 @@ data:
type: Opaque
----
-You can reference this _Secret_ in configuration properties using the `{{secret:secret-name/key-name}}` syntax.
+You can reference this Secret from the 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:
+For example, the following configuration stored in a ConfigMap references the Secret defined previously:
[source,yaml]
.my-config.yaml
@@ -109,12 +115,13 @@ metadata:
name: my-config
data:
application.properties: |
- my.message=={{secret:secret-message/MESSAGE}}
+ my.message={{secret:secret-message/MESSAGE}}
----
-You can now run the integration with the following commands to include necessary the _Secret_ and _ConfigMap_:
+You can now run the integration with the following commands to include both the Secret and ConfigMap:
-```
-kubectl apply -f my-config.yaml -f secret-message.yaml
-kamel run --secret=secret-message --configmap=my-config props.groovy
-```
\ No newline at end of file
+[source,console]
+----
+$ kubectl apply -f my-config.yaml -f secret-message.yaml
+$ kamel run --secret=secret-message --configmap=my-config props.groovy
+----