Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
scholzj committed Dec 29, 2018
1 parent bfd7636 commit a3ab9b1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Expand Up @@ -14,7 +14,7 @@
Kafka Connect connectors have their own configuration.
They are configured using the REST interface.
The connector configuration is passed to Kafka Connect as part of the HTTP requests.
In some cases, it might make sense to externalize the configuration of Kafka Connect connectors and keep it in the regular Kubernetes resources such as Config Maps or Secrets.
In some cases, it might make sense to externalize the configuration of Kafka Connect connectors and keep it in the regular Kubernetes resources such as ConfigMaps or Secrets.
This applies especially to confidential data such as usernames, passwords or certificates.

include::con-kafka-connect-external-configuration.adoc[leveloffset=+1]
Expand Down
20 changes: 10 additions & 10 deletions documentation/book/con-kafka-connect-external-configuration.adoc
Expand Up @@ -6,16 +6,16 @@

= Externalizing Kafka Connect connector configuration

{ProductName} lets you to mount Config Maps or Secrets into the Kafka Connect pods as either volumes or environment variables.
{ProductName} lets you to mount ConfigMaps or Secrets into the Kafka Connect pods as either volumes or environment variables.
The volumes and environment variables can be configured in the `externalConfiguration` property in `KafkaConnect.spec` and `KafkaConnectS2I.spec`

== External configuration as environment variable

The `env` property can be used to specify one or more environment variables.
These variables can contain a value from a Config Map or from a Secret.
These variables can contain a value from a ConfigMap or from a Secret.
The names of the environment variables configured by the user cannot start with `KAFKA_` or `STRIMZI_`.

To mount a value from a Secret to an environment variable, you have to use the `valueFrom` propert and the `secretKeyReference`
To mount a value from a Secret to an environment variable, you have to use the `valueFrom` property and the `secretKeyReference`

.Example of environment variable set to a value from a Secret
[source,yaml,subs="attributes+"]
Expand All @@ -35,9 +35,11 @@ spec:
key: my-key
----

To mount a value from a Config Map use `configMapKeyRef` in the `valueFrom` property.
A common use case for mounting Secrets into environment variables is for example when your connector needs to communicate with Amazon AWS and needs to read the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables with credentials.

To mount a value from a ConfigMap use `configMapKeyRef` in the `valueFrom` property.

.Example of environment variable set to a value from a Config Map
.Example of environment variable set to a value from a ConfigMap
[source,yaml,subs="attributes+"]
----
apiVersion: {KafkaApiVersion}
Expand All @@ -55,16 +57,14 @@ spec:
key: my-key
----

A common use case for mounting Secrets into environment variables is for example when your connector needs to communicate with Amazon AWS and needs to read the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables with credentials.

== External configuration as volume

The Config Maps and Secrets can be also mounted as volumes.
The ConfigMaps and Secrets can be also mounted as volumes.
Using volumes instead of environment variables migth be useful for example for:
* Mounting truststores / keystores with TLS certificates
* Mounting properties file which should used to configure Kafka Connect connectors

The Config Maps and Secrets which should be mounted as volumes should be listed in the `volumes` property of `externalConfiguration`.
The ConfigMaps and Secrets which should be mounted as volumes should be listed in the `volumes` property of `externalConfiguration`.
Each volume has to specify a name in the `name` property and a reference to ConfigMap or Secret.

.Example of volumes with external configuration
Expand All @@ -86,7 +86,7 @@ spec:
secretName: connector1-certificates
----

The volumes will be mounted inside the KAfka Connect containers in the path `/opt/kafka/external-configuration/_<volume-name>_`.
The volumes will be mounted inside the Kafka Connect containers in the path `/opt/kafka/external-configuration/_<volume-name>_`.
For example the files from the volume named `connector1` will be in the directory `/opt/kafka/external-configuration/connector1`.

The `FileConfigProvider` has to be used to read the values from the mounted properties files in connector configurations.
Expand Up @@ -30,7 +30,7 @@ data:
----

. Create or edit the Kafka Connect resource.
Configure the `externalProperties` section of the `KafkaConnect` or `KafkaConnectS2I` custom resource to reference the secret:
Configure the `externalConfiguration` section of the `KafkaConnect` or `KafkaConnectS2I` custom resource to reference the secret:
For example:
+
[source,yaml,subs="attributes+"]
Expand Down
Expand Up @@ -31,7 +31,7 @@ stringData:
----

. Create or edit the Kafka Connect resource.
Configure the `FileConfigProvider` in the `config` section and the `externalProperties` section of the `KafkaConnect` or `KafkaConnectS2I` custom resource to reference the secret:
Configure the `FileConfigProvider` in the `config` section and the `externalConfiguration` section of the `KafkaConnect` or `KafkaConnectS2I` custom resource to reference the secret:
For example:
+
[source,yaml,subs="attributes+"]
Expand Down

0 comments on commit a3ab9b1

Please sign in to comment.