Repository navigation
fix(chart): the Kates API's chaos, topology and conformity follow the Kafka namespace and cluster name - #441
Merged
Conversation
… Kafka namespace and cluster name The backend reads the Kafka cluster it acts on from kates.chaos.kafka.namespace and .cluster (chaos guard, orchestrator, orphan recovery, lease, Prometheus capture) and kates.topology.kafka-namespace and -cluster (topology, cluster alerts, conformity, CDC's fallback). Nothing set them, so they stayed at kafka/krafter. With `kates deploy --kafka-ns X` or `--kafka-name Y`, or kates-platform in any namespace but kafka, chaos refused every plan with "No broker pods found", topology came back empty and every conformity check returned 409. - kates 0.12.1: the configmap sets KATES_CHAOS_KAFKA_NAMESPACE and KATES_TOPOLOGY_KAFKA_NAMESPACE from networkPolicy.kafka.namespace, through tpl, with the policy on or off. It sets KATES_CHAOS_KAFKA_CLUSTER and KATES_TOPOLOGY_KAFKA_CLUSTER from a new kafka.clusterName (default krafter). The defaults are the backend's own, so a default render sets the same values as before. An extraEnv entry still wins over the configmap. The rbac.scope=namespace block that set KATES_TOPOLOGY_KAFKA_NAMESPACE (#439) goes: it rendered the same value, and would now be a duplicate key. - kates deploy sets kafka.clusterName from --kafka-name. It already set networkPolicy.kafka.namespace from the Kafka namespace. - kates-platform 0.8.2: the kates floor moves to 0.12.1, and the umbrella sets kates.kafka.clusterName (krafter) next to the bootstrap address, which names the same cluster. CI's kates-platform render check now also asserts both namespace variables. - MCP caveats dry-run-other-namespace and topology-unread-looks-empty say which chart values set these settings, with anchored refs to the configmap. Four refs into charts/kates are re-pointed past the added lines.
bmscomp
force-pushed
the
fix/kates-kafka-namespace-backend
branch
from
October 21, 2026 16:06
bdc1f02 to
9bbdb2d
Compare
This was referenced Oct 21, 2026
bmscomp
added a commit
that referenced
this pull request
Oct 21, 2026
…dminless plan with what shipped (#444) The book teaches the conformity language in its Conformity Checks chapter, but had no place that lists every field, value kind, rule id, report field and lint code. A new appendix does, after the version matrix; the chapter, the CLI Reference, the Reference part's intro and the README point to it. It is written against main as of #443: - a key set twice to the same value is a lint error that fmt fixes (#437); - with rbac.scope=namespace, zones, skew and rack awareness read the EndpointSlices of the brokers' headless Service when nodes can't be listed, and podMonitor looks in the Kafka namespace only (#439); - a refused get of the Kafka resource is a 503 naming the grant (#439), which the API Reference now says too; - the chart sets the checked namespace and cluster from networkPolicy.kafka.namespace and kafka.clusterName (#441). plans/adminless-kubernetes.md is the plan behind #439, with a status block naming what shipped in #439 and #441-#443, where the work departed from it (EndpointSlice zones; orphan recovery left on), and what is still open.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebased onto main after #438, #440 and #439 (c64e0c0). The diff against main is this PR's one commit. Merge it before #442, which is stacked on it.
Problem
The Kates API reads the Kafka cluster it acts on from four settings. Nothing sets them, so they stay at the backend's defaults:
kates.chaos.kafka.namespacekafkakates.chaos.kafka.clusterkrafterkates.topology.kafka-namespacekafkakates.topology.kafka-clusterkrafterThe
charts/katesconfigmap renders none of them.kates deploysets onlykafka.bootstrapServers,kafka.topicNamespaceandnetworkPolicy.kafka.namespace. So with Kafka anywhere butkafka/krafter, the API still looks there:kates deploy --kafka-ns Xor--kafka-name Ykafka(fix(chart): kates-platform points Kates at the Kafka it installs, in any namespace #440 fixed the bootstrap address and egress, not these)In those setups, chaos refuses every plan with
No broker pods found, topology comes back empty, alerts read the wrong PrometheusRules, and every conformity check returns 409. plans/conformity-enhancements.md already noted the 409 for--kafka-name.Fix
KATES_CHAOS_KAFKA_NAMESPACEandKATES_TOPOLOGY_KAFKA_NAMESPACEcome fromnetworkPolicy.kafka.namespace, throughtpl. That value already means "the namespace Kafka runs in" (the brokers and Trogdor), and bothkates deployand kates-platform set it. It applies whether the policy is on or off.KATES_CHAOS_KAFKA_CLUSTERandKATES_TOPOLOGY_KAFKA_CLUSTERcome from a newkafka.clusterName, defaultkrafter. It is in the schema. No existing value names the cluster.extraEnventry still wins, sinceenvoverridesenvFrom. The lab values indocs/stretched-kafkarely on that.KATES_TOPOLOGY_KAFKA_NAMESPACEfrom the same value, but only forrbac.scope=namespace. That block is gone: the line here renders the same value for every scope, and keeping both would be a duplicate key. feat(chart,conformity): rbac.scope=namespace runs tests and conformity checks without cluster admin #439's CI asserts (kafka-ns, andteamthroughtpl) pass, and each key renders once under both scopes.kates deployadds--set kafka.clusterName=<--kafka-name>. It already set the namespace.>=0.12.1.kates.kafka.clusterName: kraftersits next to the bootstrap address, so a rename ofkafka-cluster.clusterNamehas both lines to change. The README and the change note say so.platform.dry-run-other-namespace(mcp_tools_chaos.go) andtopology-unread-looks-empty(mcp_tools_cluster.go) now say which chart value sets each setting, with anchored refs to the configmap lines.charts/kates/values.yamlandconfigmap.yamlare re-pointed past the added lines, mapped through the diff from main's files.Upgrading: a release that set
networkPolicy.kafka.namespaceto anything but where Kafka runs now points chaos and topology there too. With the policy on, its egress already went there (since 0.11.1), so it had already lost Kafka.Proof
helm template … --show-only templates/configmap.yaml:The extended CI step fails with
--set kates.networkPolicy.kafka.namespace=kafka("KATES_CHAOS_KAFKA_NAMESPACE names another namespace").TestDeployCommand_KafkaUIFollowsKafkaNamenow also checks that the kates release gets--set kafka.clusterName=ordersunder--kafka-name orders.Local checks
make platform-chart-depsand the helm-deps charts. Everyrun:step of the helm-lint and kyverno-policy-test jobs passes, except kubeconform, which isn't installed here.gen-chart-table.sh --check,gen-version-matrix.sh --check,check-versions.sh,check-book-style.sh.actionlint,yamllint -c .yamllint.yaml .github config charts. The YAML Validation job needs PyYAML, which this Mac lacks; the changed YAML parses withyq.go vet ./...,go test ./...(includingTestMCPCaveatRefAnchors),golangci-lint run --new-from-rev=origin/main(0 issues),govulncheck(none),check-cli-style.sh,check-cli-compat.sh../mvnw test -Dquarkus.grpc.codegen.skip=true -Dquarkus.http.test-port=0passes: 1,490 tests in 141 classes, 0 failures, 1 skipped. There is no backend change; CI runs it becausecli/**changed. ITs, Docker and native builds run in CI only.Not in this PR
targetNamespaceout getskafka, a literal inFaultSpec.Builder(FaultSpec.java:83), notkates.chaos.kafka.namespace. With Kafka elsewhere, the guard refuses such a step. That needs a backend fix.kates/k8s/configmap.yaml, the raw manifests, still leaves these settings at the backend defaults. Those manifests put Kafka inkafka.docs/stretched-kafkasetsKATES_CHAOS_KAFKA_CLUSTERthroughextraEnv. That still works;kafka.clusterNamewould now cover topology too.