From 97c24eca80155e08635564b103782d21ce345a8c Mon Sep 17 00:00:00 2001 From: Calum Murray Date: Wed, 7 Feb 2024 14:12:44 -0500 Subject: [PATCH 1/2] doc: documented how to set topic config Signed-off-by: Calum Murray --- .../broker-types/kafka-broker/README.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/eventing/brokers/broker-types/kafka-broker/README.md b/docs/eventing/brokers/broker-types/kafka-broker/README.md index 502f9c8285..640cbbedee 100644 --- a/docs/eventing/brokers/broker-types/kafka-broker/README.md +++ b/docs/eventing/brokers/broker-types/kafka-broker/README.md @@ -113,6 +113,27 @@ different `name` on your Kafka Broker's `spec.config` field. !!! note 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`. +Knative supports the full set of topic config options that your version of Kafka supports. To set any of these, you need to add a key to the configmap with the `default.topic.config.` prefix. +For example, to set the `retention.ms` value you would modify the `ConfigMap` to look like the following: + +```yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: kafka-broker-config + namespace: knative-eventing +data: + # Number of topic partitions + default.topic.partitions: "10" + # Replication factor of topic messages. + default.topic.replication.factor: "3" + # A comma separated list of bootstrap servers. (It can be in or out the k8s cluster) + bootstrap.servers: "my-cluster-kafka-bootstrap.kafka:9092" + # Here is our retention.ms config + default.topic.config.retention.ms: "3600" +``` + + ## Set as default broker implementation To set the Kafka broker as the default implementation for all brokers in the Knative deployment, From 3127b35628cdf6161ccd78ad771964fa7a88c1f7 Mon Sep 17 00:00:00 2001 From: Calum Murray Date: Thu, 8 Feb 2024 14:54:37 -0500 Subject: [PATCH 2/2] doc: add link to allowed kafka topic config options Signed-off-by: Calum Murray --- docs/eventing/brokers/broker-types/kafka-broker/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/eventing/brokers/broker-types/kafka-broker/README.md b/docs/eventing/brokers/broker-types/kafka-broker/README.md index 640cbbedee..9fec6c0368 100644 --- a/docs/eventing/brokers/broker-types/kafka-broker/README.md +++ b/docs/eventing/brokers/broker-types/kafka-broker/README.md @@ -113,7 +113,7 @@ different `name` on your Kafka Broker's `spec.config` field. !!! note 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`. -Knative supports the full set of topic config options that your version of Kafka supports. To set any of these, you need to add a key to the configmap with the `default.topic.config.` prefix. +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. For example, to set the `retention.ms` value you would modify the `ConfigMap` to look like the following: ```yaml @@ -133,7 +133,6 @@ data: default.topic.config.retention.ms: "3600" ``` - ## Set as default broker implementation To set the Kafka broker as the default implementation for all brokers in the Knative deployment,