Skip to content

Commit ffa98da

Browse files
[release-1.13] Document how to set Kafka Topic config options (#5859)
* doc: documented how to set topic config Signed-off-by: Calum Murray <cmurray@redhat.com> * doc: add link to allowed kafka topic config options Signed-off-by: Calum Murray <cmurray@redhat.com> --------- Signed-off-by: Calum Murray <cmurray@redhat.com> Co-authored-by: Calum Murray <cmurray@redhat.com>
1 parent 0a4328a commit ffa98da

File tree

1 file changed

+20
-0
lines changed
  • docs/eventing/brokers/broker-types/kafka-broker

1 file changed

+20
-0
lines changed

docs/eventing/brokers/broker-types/kafka-broker/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,26 @@ different `name` on your Kafka Broker's `spec.config` field.
113113
!!! note
114114
The `default.topic.replication.factor` value must be less than or equal to the number of Kafka broker instances in your cluster. For example, if you only have one Kafka broker, the `default.topic.replication.factor` value should not be more than `1`.
115115
116+
Knative supports the [full set of topic config options that your version of Kafka supports](https://kafka.apache.org/documentation/#topicconfigs). To set any of these, you need to add a key to the configmap with the `default.topic.config.` prefix.
117+
For example, to set the `retention.ms` value you would modify the `ConfigMap` to look like the following:
118+
119+
```yaml
120+
apiVersion: v1
121+
kind: ConfigMap
122+
metadata:
123+
name: kafka-broker-config
124+
namespace: knative-eventing
125+
data:
126+
# Number of topic partitions
127+
default.topic.partitions: "10"
128+
# Replication factor of topic messages.
129+
default.topic.replication.factor: "3"
130+
# A comma separated list of bootstrap servers. (It can be in or out the k8s cluster)
131+
bootstrap.servers: "my-cluster-kafka-bootstrap.kafka:9092"
132+
# Here is our retention.ms config
133+
default.topic.config.retention.ms: "3600"
134+
```
135+
116136
## Set as default broker implementation
117137
118138
To set the Kafka broker as the default implementation for all brokers in the Knative deployment,

0 commit comments

Comments
 (0)