From 0943500a81710fdbc515ee15ed7a2378980ea65d Mon Sep 17 00:00:00 2001 From: Daniel Vaseekaran Date: Mon, 2 Dec 2024 16:24:52 -0500 Subject: [PATCH] Updated Kraft Test Cases --- pkg/resources/kafka/configmap_test.go | 92 +++++++++++++++++++-------- 1 file changed, 64 insertions(+), 28 deletions(-) diff --git a/pkg/resources/kafka/configmap_test.go b/pkg/resources/kafka/configmap_test.go index db52d70c3..417afdf63 100644 --- a/pkg/resources/kafka/configmap_test.go +++ b/pkg/resources/kafka/configmap_test.go @@ -1102,7 +1102,7 @@ process.roles=broker,controller }, }, expectedBrokerConfigs: []string{ - `advertised.listeners=CONTROLLER://kafka-0.kafka.svc.cluster.local:9093,INTERNAL://kafka-0.kafka.svc.cluster.local:9092 + `advertised.listeners=INTERNAL://kafka-0.kafka.svc.cluster.local:9092 controller.listener.names=CONTROLLER controller.quorum.voters=500@kafka-500.kafka.svc.cluster.local:9093 cruise.control.metrics.reporter.bootstrap.servers=kafka-all-broker.kafka.svc.cluster.local:9092 @@ -1128,14 +1128,13 @@ listener.name.internal.ssl.truststore.location=/var/run/secrets/java.io/keystore listener.name.internal.ssl.truststore.password= listener.name.internal.ssl.truststore.type=JKS listener.security.protocol.map=INTERNAL:SSL,CONTROLLER:SSL -listeners=INTERNAL://:9092,CONTROLLER://:9093 +listeners=INTERNAL://:9092 log.dirs=/test-kafka-logs/kafka,/test-kafka-logs-0/kafka metric.reporters=com.linkedin.kafka.cruisecontrol.metricsreporter.CruiseControlMetricsReporter node.id=0 process.roles=broker `, - `advertised.listeners=CONTROLLER://kafka-0.kafka.svc.cluster.local:9093,INTERNAL://kafka-0.kafka.svc.cluster.local:9092 -controller.listener.names=CONTROLLER + `controller.listener.names=CONTROLLER controller.quorum.voters=500@kafka-500.kafka.svc.cluster.local:9093 cruise.control.metrics.reporter.bootstrap.servers=kafka-all-broker.kafka.svc.cluster.local:9092 cruise.control.metrics.reporter.kubernetes.mode=true @@ -1160,13 +1159,13 @@ listener.name.internal.ssl.truststore.location=/var/run/secrets/java.io/keystore listener.name.internal.ssl.truststore.password= listener.name.internal.ssl.truststore.type=JKS listener.security.protocol.map=INTERNAL:SSL,CONTROLLER:SSL -listeners=INTERNAL://:9092,CONTROLLER://:9093 +listeners=CONTROLLER://:9093 log.dirs=/test-kafka-logs/kafka metric.reporters=com.linkedin.kafka.cruisecontrol.metricsreporter.CruiseControlMetricsReporter node.id=500 process.roles=controller `, - `advertised.listeners=CONTROLLER://kafka-200.kafka.svc.cluster.local:9093,INTERNAL://kafka-200.kafka.svc.cluster.local:9092 + `advertised.listeners=INTERNAL://kafka-200.kafka.svc.cluster.local:9092 controller.listener.names=CONTROLLER controller.quorum.voters=500@kafka-500.kafka.svc.cluster.local:9093 cruise.control.metrics.reporter.bootstrap.servers=kafka-all-broker.kafka.svc.cluster.local:9092 @@ -1192,7 +1191,7 @@ listener.name.internal.ssl.truststore.location=/var/run/secrets/java.io/keystore listener.name.internal.ssl.truststore.password= listener.name.internal.ssl.truststore.type=JKS listener.security.protocol.map=INTERNAL:SSL,CONTROLLER:SSL -listeners=INTERNAL://:9092,CONTROLLER://:9093 +listeners=INTERNAL://:9092 log.dirs=/test-kafka-logs/kafka metric.reporters=com.linkedin.kafka.cruisecontrol.metricsreporter.CruiseControlMetricsReporter node.id=200 @@ -1299,44 +1298,81 @@ process.roles=broker }, }, expectedBrokerConfigs: []string{ - `advertised.listeners=CONTROLLER://kafka-0.kafka.svc.cluster.local:9092,INTERNAL://kafka-0.kafka.svc.cluster.local:9092 -controller.listener.names=CONTROLLER + `advertised.listeners=INTERNAL://kafka-0.kafka.svc.cluster.local:9092 controller.quorum.voters=500@kafka-500.kafka.svc.cluster.local:9093 cruise.control.metrics.reporter.bootstrap.servers=kafka-all-broker.kafka.svc.cluster.local:9092 cruise.control.metrics.reporter.kubernetes.mode=true -inter.broker.listener.name=INTERNAL -listener.security.protocol.map=INTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT -listeners=INTERNAL://:9092,CONTROLLER://:9093 +inter.broker.listener.name= +listener.name.controller.ssl.client.auth=none +listener.name.controller.ssl.keystore.location=/var/run/secrets/java.io/keystores/server/controller/keystore.jks +listener.name.controller.ssl.keystore.password= +listener.name.controller.ssl.keystore.type=JKS +listener.name.controller.ssl.truststore.location=/var/run/secrets/java.io/keystores/server/controller/truststore.jks +listener.name.controller.ssl.truststore.password= +listener.name.controller.ssl.truststore.type=JKS +listener.name.external.ssl.client.auth=none +listener.name.external.ssl.keystore.location=/var/run/secrets/java.io/keystores/server/external/keystore.jks +listener.name.external.ssl.keystore.password= +listener.name.external.ssl.keystore.type=JKS +listener.name.external.ssl.truststore.location=/var/run/secrets/java.io/keystores/server/external/truststore.jks +listener.name.external.ssl.truststore.password= +listener.name.external.ssl.truststore.type=JKS +listener.security.protocol.map=EXTERNAL:SSL,CONTROLLER:SSL +listeners= log.dirs=/test-kafka-logs/kafka,/test-kafka-logs-0/kafka metric.reporters=com.linkedin.kafka.cruisecontrol.metricsreporter.CruiseControlMetricsReporter node.id=0 process.roles=broker `, - `advertised.listeners=CONTROLLER://kafka-0.kafka.svc.cluster.local:9092,INTERNAL://kafka-0.kafka.svc.cluster.local:9092 -controller.listener.names=CONTROLLER -controller.quorum.voters=500@kafka-500.kafka.svc.cluster.local:9093 + `controller.quorum.voters=500@kafka-500.kafka.svc.cluster.local:9093 cruise.control.metrics.reporter.bootstrap.servers=kafka-all-broker.kafka.svc.cluster.local:9092 cruise.control.metrics.reporter.kubernetes.mode=true -inter.broker.listener.name=INTERNAL -listener.security.protocol.map=INTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT -listeners=INTERNAL://:9092,CONTROLLER://:9093 -log.dirs=/test-kafka-logs/kafka,/test-kafka-logs-0/kafka +inter.broker.listener.name= +listener.name.controller.ssl.client.auth=none +listener.name.controller.ssl.keystore.location=/var/run/secrets/java.io/keystores/server/controller/keystore.jks +listener.name.controller.ssl.keystore.password= +listener.name.controller.ssl.keystore.type=JKS +listener.name.controller.ssl.truststore.location=/var/run/secrets/java.io/keystores/server/controller/truststore.jks +listener.name.controller.ssl.truststore.password= +listener.name.controller.ssl.truststore.type=JKS +listener.name.external.ssl.client.auth=none +listener.name.external.ssl.keystore.location=/var/run/secrets/java.io/keystores/server/external/keystore.jks +listener.name.external.ssl.keystore.password= +listener.name.external.ssl.keystore.type=JKS +listener.name.external.ssl.truststore.location=/var/run/secrets/java.io/keystores/server/external/truststore.jks +listener.name.external.ssl.truststore.password= +listener.name.external.ssl.truststore.type=JKS +listener.security.protocol.map=EXTERNAL:SSL,CONTROLLER:SSL +listeners=EXTERNAL://:9092 +log.dirs=/test-kafka-logs/kafka metric.reporters=com.linkedin.kafka.cruisecontrol.metricsreporter.CruiseControlMetricsReporter -node.id=0 -process.roles=broker +node.id=500 +process.roles=controller `, `advertised.listeners=INTERNAL://kafka-200.kafka.svc.cluster.local:9092 -advertised.listeners=CONTROLLER://kafka-200.kafka.svc.cluster.local:9092,INTERNAL://kafka-0.kafka.svc.cluster.local:9092 -controller.listener.names=CONTROLLER controller.quorum.voters=500@kafka-500.kafka.svc.cluster.local:9093 cruise.control.metrics.reporter.bootstrap.servers=kafka-all-broker.kafka.svc.cluster.local:9092 cruise.control.metrics.reporter.kubernetes.mode=true -inter.broker.listener.name=INTERNAL -listener.security.protocol.map=INTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT -listeners=INTERNAL://:9092,CONTROLLER://:9093 -log.dirs=/test-kafka-logs/kafka,/test-kafka-logs-0/kafka +inter.broker.listener.name= +listener.name.controller.ssl.client.auth=none +listener.name.controller.ssl.keystore.location=/var/run/secrets/java.io/keystores/server/controller/keystore.jks +listener.name.controller.ssl.keystore.password= +listener.name.controller.ssl.keystore.type=JKS +listener.name.controller.ssl.truststore.location=/var/run/secrets/java.io/keystores/server/controller/truststore.jks +listener.name.controller.ssl.truststore.password= +listener.name.controller.ssl.truststore.type=JKS +listener.name.external.ssl.client.auth=none +listener.name.external.ssl.keystore.location=/var/run/secrets/java.io/keystores/server/external/keystore.jks +listener.name.external.ssl.keystore.password= +listener.name.external.ssl.keystore.type=JKS +listener.name.external.ssl.truststore.location=/var/run/secrets/java.io/keystores/server/external/truststore.jks +listener.name.external.ssl.truststore.password= +listener.name.external.ssl.truststore.type=JKS +listener.security.protocol.map=EXTERNAL:SSL,CONTROLLER:SSL +listeners= +log.dirs=/test-kafka-logs/kafka metric.reporters=com.linkedin.kafka.cruisecontrol.metricsreporter.CruiseControlMetricsReporter -node.id=0 +node.id=200 process.roles=broker `}, },