From 19bccbbbabd6839f6cd32321265960c71c4eb061 Mon Sep 17 00:00:00 2001 From: Techassi Date: Thu, 19 Nov 2026 12:19:20 +0100 Subject: [PATCH 1/2] chore: Release 26.11.0-rc1 (#1072) * chore: Release 26.11.0-rc1 Signed-off-by: Techassi * chore: Bump libz-sys to 1.1.33 to negate RUSTSEC-2026-0544 * chore: Bump serde-saphyr to 2.2.0 because 2.1.0 was yanked --------- Signed-off-by: Techassi --- CHANGELOG.md | 2 + Cargo.lock | 22 ++--- Cargo.nix | 22 ++--- Cargo.toml | 2 +- deploy/helm/kafka-operator/Chart.yaml | 4 +- docs/antora.yml | 3 +- .../getting_started/getting_started.sh | 20 ++--- .../getting_started/install_output.txt | 10 +-- docs/templating_vars.yaml | 10 +-- extra/crds.yaml | 86 +++++++++---------- tests/release.yaml | 12 +-- .../kuttl/smoke-kraft/33-assert.yaml.j2 | 2 +- tests/templates/kuttl/smoke/34-assert.yaml.j2 | 2 +- .../templates/kuttl/upgrade/04-assert.yaml.j2 | 4 +- 14 files changed, 102 insertions(+), 99 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc8ca11c7..2afc806a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +## [26.11.0-rc1] - 2026-11-19 + ### Added - Support floating tags for product images via the new `spec.image.stackableVersionPolicy` field diff --git a/Cargo.lock b/Cargo.lock index f291f0ee0..5a0de63e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1133,9 +1133,9 @@ dependencies = [ [[package]] name = "granit-parser" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f05586d4d4df3d47123207826c40b252728b438a1a07bad3c01ee6bea401df" +checksum = "9bd04d0d9c7079b416b458d2317aea4aa964c81938cb7c20f559758c4f422dc8" dependencies = [ "arraydeque", "smallvec", @@ -1906,9 +1906,9 @@ checksum = "2e126dda6f34391ab7b444f9922055facc83c07a910da3eb16f1e4d9c45dc777" [[package]] name = "libz-sys" -version = "1.1.31" +version = "1.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff20308ecabd635a2dc1dd5834a86c462cca20efba1d5d3ddab1f8aea3455cb2" +checksum = "fee3f59f4321dab0c78d828942e7aa09d0bd8ad6e78a501977e6bf3d02938045" dependencies = [ "cc", "libc", @@ -2898,12 +2898,12 @@ dependencies = [ [[package]] name = "serde-saphyr" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d43fb82d550b07e6f929a58d7d0935182602f48ddead875f5ee313c41c8f07fe" +checksum = "969cde0349344dbbf58b5f9badbfb8f806db13969364eb8007c057ef687007d9" dependencies = [ "annotate-snippets", - "base64 0.23.1", + "base64 0.22.1", "encoding_rs_io", "granit-parser", "nohash-hasher", @@ -3197,7 +3197,7 @@ dependencies = [ [[package]] name = "stackable-kafka-admin" -version = "0.0.0-dev" +version = "26.11.0-rc1" dependencies = [ "anyhow", "base64 0.22.1", @@ -3214,7 +3214,7 @@ dependencies = [ [[package]] name = "stackable-kafka-agent" -version = "0.0.0-dev" +version = "26.11.0-rc1" dependencies = [ "anyhow", "axum", @@ -3235,7 +3235,7 @@ dependencies = [ [[package]] name = "stackable-kafka-operator" -version = "0.0.0-dev" +version = "26.11.0-rc1" dependencies = [ "anyhow", "built", @@ -3258,7 +3258,7 @@ dependencies = [ [[package]] name = "stackable-kafka-shared" -version = "0.0.0-dev" +version = "26.11.0-rc1" dependencies = [ "indoc", "regex", diff --git a/Cargo.nix b/Cargo.nix index 5aa956706..701d0d941 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -3667,10 +3667,10 @@ rec { }; "granit-parser" = rec { crateName = "granit-parser"; - version = "2.1.0"; + version = "2.2.0"; edition = "2021"; crateBin = []; - sha256 = "1pq1ljzfc7n0sfx0f6la8f5p4lmj81n841rj293kvpylsj35bw05"; + sha256 = "1j1d897qqxarylh7rjrq37469aaax9x33ljqnhbb8ybhkh6lvl4v"; libName = "granit_parser"; license = "MIT OR Apache-2.0"; authors = [ @@ -6439,10 +6439,10 @@ rec { }; "libz-sys" = rec { crateName = "libz-sys"; - version = "1.1.31"; + version = "1.1.33"; edition = "2018"; links = "z"; - sha256 = "1cjw8nisxy5iv8yms7dsxwhclb26djl38n6xq4nmlqxxra73087z"; + sha256 = "0ic0jc13vgz6fwcm12p7ss5bvl09mbkl52c2ip3v1ni18fgzbqzy"; libName = "libz_sys"; license = "MIT OR Apache-2.0"; authors = [ @@ -9912,10 +9912,10 @@ rec { }; "serde-saphyr" = rec { crateName = "serde-saphyr"; - version = "2.1.1"; + version = "2.2.0"; edition = "2024"; crateBin = []; - sha256 = "1zh7iwfc84z3brgqgbfyips049hq6l4pv3d557wyc1qbalnvhgyl"; + sha256 = "1n87f1lfymy00y0fnr4kjq9xn1pqp2zsv6szigsvnk9l941xx74n"; libName = "serde_saphyr"; license = "MIT OR Apache-2.0"; dependencies = [ @@ -9926,7 +9926,7 @@ rec { } { name = "base64"; - packageId = "base64 0.23.1"; + packageId = "base64 0.22.1"; optional = true; } { @@ -10862,7 +10862,7 @@ rec { }; "stackable-kafka-admin" = rec { crateName = "stackable-kafka-admin"; - version = "0.0.0-dev"; + version = "26.11.0-rc1"; edition = "2024"; src = lib.cleanSourceWith { filter = sourceFilter; src = ./rust/kafka-admin; }; libName = "stackable_kafka_admin"; @@ -10935,7 +10935,7 @@ rec { }; "stackable-kafka-agent" = rec { crateName = "stackable-kafka-agent"; - version = "0.0.0-dev"; + version = "26.11.0-rc1"; edition = "2024"; crateBin = [ { @@ -11023,7 +11023,7 @@ rec { }; "stackable-kafka-operator" = rec { crateName = "stackable-kafka-operator"; - version = "0.0.0-dev"; + version = "26.11.0-rc1"; edition = "2024"; crateBin = [ { @@ -11122,7 +11122,7 @@ rec { }; "stackable-kafka-shared" = rec { crateName = "stackable-kafka-shared"; - version = "0.0.0-dev"; + version = "26.11.0-rc1"; edition = "2024"; src = lib.cleanSourceWith { filter = sourceFilter; src = ./rust/shared; }; libName = "stackable_kafka_shared"; diff --git a/Cargo.toml b/Cargo.toml index d2490e846..b18ef2c56 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["rust/operator-binary", "rust/agent-binary", "rust/kafka-admin", "rus resolver = "2" [workspace.package] -version = "0.0.0-dev" +version = "26.11.0-rc1" authors = ["Stackable GmbH "] license = "OSL-3.0" edition = "2024" diff --git a/deploy/helm/kafka-operator/Chart.yaml b/deploy/helm/kafka-operator/Chart.yaml index f895b1faa..c4b3e1757 100644 --- a/deploy/helm/kafka-operator/Chart.yaml +++ b/deploy/helm/kafka-operator/Chart.yaml @@ -1,8 +1,8 @@ --- apiVersion: v2 name: kafka-operator -version: "0.0.0-dev" -appVersion: "0.0.0-dev" +version: "26.11.0-rc1" +appVersion: "26.11.0-rc1" description: "Kubernetes operator for Apache Kafka. Deploy and run Kafka brokers with the Stackable Data Platform (SDP)." home: https://github.com/stackabletech/kafka-operator # One known use of this is the Artifact Hub (AH) listing which shows the logo. diff --git a/docs/antora.yml b/docs/antora.yml index d522680b3..8eedc347b 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -1,3 +1,4 @@ --- name: home -version: "nightly" +version: "26.11" +prerelease: false diff --git a/docs/modules/kafka/examples/getting_started/getting_started.sh b/docs/modules/kafka/examples/getting_started/getting_started.sh index d131a0197..8fb173a91 100755 --- a/docs/modules/kafka/examples/getting_started/getting_started.sh +++ b/docs/modules/kafka/examples/getting_started/getting_started.sh @@ -29,22 +29,22 @@ case "$1" in "helm") echo "Installing Operators with Helm" # tag::helm-install-operators[] -helm install --wait commons-operator oci://oci.stackable.tech/sdp-charts/commons-operator --version 0.0.0-dev -helm install --wait secret-operator oci://oci.stackable.tech/sdp-charts/secret-operator --version 0.0.0-dev -helm install --wait listener-operator oci://oci.stackable.tech/sdp-charts/listener-operator --version 0.0.0-dev -helm install --wait zookeeper-operator oci://oci.stackable.tech/sdp-charts/zookeeper-operator --version 0.0.0-dev -helm install --wait kafka-operator oci://oci.stackable.tech/sdp-charts/kafka-operator --version 0.0.0-dev +helm install --wait commons-operator oci://oci.stackable.tech/sdp-charts/commons-operator --version 26.11.0-rc1 +helm install --wait secret-operator oci://oci.stackable.tech/sdp-charts/secret-operator --version 26.11.0-rc1 +helm install --wait listener-operator oci://oci.stackable.tech/sdp-charts/listener-operator --version 26.11.0-rc1 +helm install --wait zookeeper-operator oci://oci.stackable.tech/sdp-charts/zookeeper-operator --version 26.11.0-rc1 +helm install --wait kafka-operator oci://oci.stackable.tech/sdp-charts/kafka-operator --version 26.11.0-rc1 # end::helm-install-operators[] ;; "stackablectl") echo "installing Operators with stackablectl" # tag::stackablectl-install-operators[] stackablectl operator install \ - commons=0.0.0-dev \ - secret=0.0.0-dev \ - listener=0.0.0-dev \ - zookeeper=0.0.0-dev \ - kafka=0.0.0-dev + commons=26.11.0-rc1 \ + secret=26.11.0-rc1 \ + listener=26.11.0-rc1 \ + zookeeper=26.11.0-rc1 \ + kafka=26.11.0-rc1 # end::stackablectl-install-operators[] ;; *) diff --git a/docs/modules/kafka/examples/getting_started/install_output.txt b/docs/modules/kafka/examples/getting_started/install_output.txt index 4622a2cb7..c54ced01c 100644 --- a/docs/modules/kafka/examples/getting_started/install_output.txt +++ b/docs/modules/kafka/examples/getting_started/install_output.txt @@ -1,5 +1,5 @@ -Installed commons=0.0.0-dev operator -Installed secret=0.0.0-dev operator -Installed listener=0.0.0-dev operator -Installed zookeeper=0.0.0-dev operator -Installed kafka=0.0.0-dev operator +Installed commons=26.11.0-rc1 operator +Installed secret=26.11.0-rc1 operator +Installed listener=26.11.0-rc1 operator +Installed zookeeper=26.11.0-rc1 operator +Installed kafka=26.11.0-rc1 operator diff --git a/docs/templating_vars.yaml b/docs/templating_vars.yaml index 36c236b5f..f60a0dd62 100644 --- a/docs/templating_vars.yaml +++ b/docs/templating_vars.yaml @@ -3,8 +3,8 @@ helm: repo_name: sdp-charts repo_url: oci.stackable.tech versions: - commons: 0.0.0-dev - secret: 0.0.0-dev - listener: 0.0.0-dev - zookeeper: 0.0.0-dev - kafka: 0.0.0-dev + commons: 26.11.0-rc1 + secret: 26.11.0-rc1 + listener: 26.11.0-rc1 + zookeeper: 26.11.0-rc1 + kafka: 26.11.0-rc1 diff --git a/extra/crds.yaml b/extra/crds.yaml index 1f967db75..dabe6a3a7 100644 --- a/extra/crds.yaml +++ b/extra/crds.yaml @@ -22,7 +22,7 @@ spec: description: |- A Kafka cluster stacklet. This resource is managed by the Stackable operator for Apache Kafka. Find more information on how to use it and the resources that the operator generates in the - [operator documentation](https://docs.stackable.tech/home/nightly/kafka/). + [operator documentation](https://docs.stackable.tech/home/26.11/kafka/). properties: brokers: description: |- @@ -32,7 +32,7 @@ spec: on role level. There is also a second form of config, which can only be configured at role level, the `roleConfig`. You can learn more about this in the - [Roles and role group concept documentation](https://docs.stackable.tech/home/nightly/concepts/roles-and-role-groups). + [Roles and role group concept documentation](https://docs.stackable.tech/home/26.11/concepts/roles-and-role-groups). properties: cliOverrides: additionalProperties: @@ -50,7 +50,7 @@ spec: podAntiAffinity: null description: |- These configuration settings control - [Pod placement](https://docs.stackable.tech/home/nightly/concepts/operations/pod_placement). + [Pod placement](https://docs.stackable.tech/home/26.11/concepts/operations/pod_placement). properties: nodeAffinity: description: Same as the `spec.affinity.nodeAffinity` field on the Pod, see the [Kubernetes docs](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node) @@ -96,7 +96,7 @@ spec: default: containers: {} enableVectorAgent: null - description: Logging configuration, learn more in the [logging concept documentation](https://docs.stackable.tech/home/nightly/concepts/logging). + description: Logging configuration, learn more in the [logging concept documentation](https://docs.stackable.tech/home/26.11/concepts/logging). properties: containers: description: Log configuration per container. @@ -378,7 +378,7 @@ spec: description: |- The `configOverrides` can be used to configure properties in product config files that are not exposed in the CRD. Read the - [config overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#config-overrides) + [config overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#config-overrides) and consult the operator specific usage guide documentation for details on the available config files and settings for the specific product. properties: @@ -404,7 +404,7 @@ spec: It is a map from environment variable names to their values. The names are validated to be valid environment variable names. Read the - [environment variable overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#env-overrides) + [environment variable overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#env-overrides) for more information and consult the operator specific usage guide to find out about the product specific environment variables that are available. type: object @@ -415,7 +415,7 @@ spec: removeRegex: [] description: |- Allows overriding JVM arguments. - Please read on the [JVM argument overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#jvm-argument-overrides) + Please read on the [JVM argument overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#jvm-argument-overrides) for details on the usage. properties: add: @@ -444,7 +444,7 @@ spec: [PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podtemplatespec-v1-core) to override any property that can be set on a Kubernetes Pod. Read the - [Pod overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#pod-overrides) + [Pod overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#pod-overrides) for more information. type: object x-kubernetes-preserve-unknown-fields: true @@ -466,7 +466,7 @@ spec: 2. The allowed number of Pods to be unavailable (`maxUnavailable`) Learn more in the - [allowed Pod disruptions documentation](https://docs.stackable.tech/home/nightly/concepts/operations/pod_disruptions). + [allowed Pod disruptions documentation](https://docs.stackable.tech/home/26.11/concepts/operations/pod_disruptions). properties: enabled: default: true @@ -506,7 +506,7 @@ spec: podAntiAffinity: null description: |- These configuration settings control - [Pod placement](https://docs.stackable.tech/home/nightly/concepts/operations/pod_placement). + [Pod placement](https://docs.stackable.tech/home/26.11/concepts/operations/pod_placement). properties: nodeAffinity: description: Same as the `spec.affinity.nodeAffinity` field on the Pod, see the [Kubernetes docs](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node) @@ -552,7 +552,7 @@ spec: default: containers: {} enableVectorAgent: null - description: Logging configuration, learn more in the [logging concept documentation](https://docs.stackable.tech/home/nightly/concepts/logging). + description: Logging configuration, learn more in the [logging concept documentation](https://docs.stackable.tech/home/26.11/concepts/logging). properties: containers: description: Log configuration per container. @@ -834,7 +834,7 @@ spec: description: |- The `configOverrides` can be used to configure properties in product config files that are not exposed in the CRD. Read the - [config overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#config-overrides) + [config overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#config-overrides) and consult the operator specific usage guide documentation for details on the available config files and settings for the specific product. properties: @@ -860,7 +860,7 @@ spec: It is a map from environment variable names to their values. The names are validated to be valid environment variable names. Read the - [environment variable overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#env-overrides) + [environment variable overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#env-overrides) for more information and consult the operator specific usage guide to find out about the product specific environment variables that are available. type: object @@ -871,7 +871,7 @@ spec: removeRegex: [] description: |- Allows overriding JVM arguments. - Please read on the [JVM argument overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#jvm-argument-overrides) + Please read on the [JVM argument overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#jvm-argument-overrides) for details on the usage. properties: add: @@ -900,7 +900,7 @@ spec: [PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podtemplatespec-v1-core) to override any property that can be set on a Kubernetes Pod. Read the - [Pod overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#pod-overrides) + [Pod overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#pod-overrides) for more information. type: object x-kubernetes-preserve-unknown-fields: true @@ -924,7 +924,7 @@ spec: names it `default`. Read the - [roles and role groups concept documentation](https://docs.stackable.tech/home/nightly/concepts/roles-and-role-groups) + [roles and role groups concept documentation](https://docs.stackable.tech/home/26.11/concepts/roles-and-role-groups) for more details. type: object required: @@ -978,15 +978,15 @@ spec: properties: opa: description: |- - Configure the OPA stacklet [discovery ConfigMap](https://docs.stackable.tech/home/nightly/concepts/service_discovery) + Configure the OPA stacklet [discovery ConfigMap](https://docs.stackable.tech/home/26.11/concepts/service_discovery) and the name of the Rego package containing your authorization rules. - Consult the [OPA authorization documentation](https://docs.stackable.tech/home/nightly/concepts/opa) + Consult the [OPA authorization documentation](https://docs.stackable.tech/home/26.11/concepts/opa) to learn how to deploy Rego authorization rules with OPA. nullable: true properties: configMapName: description: |- - The [discovery ConfigMap](https://docs.stackable.tech/home/nightly/concepts/service_discovery) + The [discovery ConfigMap](https://docs.stackable.tech/home/26.11/concepts/service_discovery) for the OPA stacklet that should be used for authorization requests. type: string package: @@ -1123,7 +1123,7 @@ spec: internalSecretClass: default: tls description: |- - The [SecretClass](https://docs.stackable.tech/home/nightly/secret-operator/secretclass.html) to use for + The [SecretClass](https://docs.stackable.tech/home/26.11/secret-operator/secretclass.html) to use for internal broker communication. Use mutual verification between brokers (mandatory). This setting controls: - Which cert the brokers should use to authenticate themselves against other brokers @@ -1137,7 +1137,7 @@ spec: serverSecretClass: default: tls description: |- - The [SecretClass](https://docs.stackable.tech/home/nightly/secret-operator/secretclass.html) to use for + The [SecretClass](https://docs.stackable.tech/home/26.11/secret-operator/secretclass.html) to use for client connections. This setting controls: - If TLS encryption is used at all - Which cert the servers should use to authenticate themselves against the client @@ -1151,9 +1151,9 @@ spec: type: object vectorAggregatorConfigMapName: description: |- - Name of the Vector aggregator [discovery ConfigMap](https://docs.stackable.tech/home/nightly/concepts/service_discovery). + Name of the Vector aggregator [discovery ConfigMap](https://docs.stackable.tech/home/26.11/concepts/service_discovery). It must contain the key `ADDRESS` with the address of the Vector aggregator. - Follow the [logging tutorial](https://docs.stackable.tech/home/nightly/tutorials/logging-vector-aggregator) + Follow the [logging tutorial](https://docs.stackable.tech/home/26.11/tutorials/logging-vector-aggregator) to learn how to configure log aggregation with Vector. maxLength: 253 minLength: 1 @@ -1162,8 +1162,8 @@ spec: type: string zookeeperConfigMapName: description: |- - Provide the name of the ZooKeeper [discovery ConfigMap](https://docs.stackable.tech/home/nightly/concepts/service_discovery) - here. When using the [Stackable operator for Apache ZooKeeper](https://docs.stackable.tech/home/nightly/zookeeper/) + Provide the name of the ZooKeeper [discovery ConfigMap](https://docs.stackable.tech/home/26.11/concepts/service_discovery) + here. When using the [Stackable operator for Apache ZooKeeper](https://docs.stackable.tech/home/26.11/zookeeper/) to deploy a ZooKeeper cluster, this will simply be the name of your ZookeeperCluster resource. This can only be used up to Kafka version 3.9.x. Since Kafka 4.0.0, ZooKeeper support was dropped. Please use the 'controller' role instead. @@ -1178,7 +1178,7 @@ spec: reconciliationPaused: false stopped: false description: |- - [Cluster operations](https://docs.stackable.tech/home/nightly/concepts/operations/cluster_operations) + [Cluster operations](https://docs.stackable.tech/home/26.11/concepts/operations/cluster_operations) properties, allow stopping the product instance as well as pausing reconciliation. properties: reconciliationPaused: @@ -1209,7 +1209,7 @@ spec: on role level. There is also a second form of config, which can only be configured at role level, the `roleConfig`. You can learn more about this in the - [Roles and role group concept documentation](https://docs.stackable.tech/home/nightly/concepts/roles-and-role-groups). + [Roles and role group concept documentation](https://docs.stackable.tech/home/26.11/concepts/roles-and-role-groups). nullable: true properties: cliOverrides: @@ -1228,7 +1228,7 @@ spec: podAntiAffinity: null description: |- These configuration settings control - [Pod placement](https://docs.stackable.tech/home/nightly/concepts/operations/pod_placement). + [Pod placement](https://docs.stackable.tech/home/26.11/concepts/operations/pod_placement). properties: nodeAffinity: description: Same as the `spec.affinity.nodeAffinity` field on the Pod, see the [Kubernetes docs](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node) @@ -1260,7 +1260,7 @@ spec: default: containers: {} enableVectorAgent: null - description: Logging configuration, learn more in the [logging concept documentation](https://docs.stackable.tech/home/nightly/concepts/logging). + description: Logging configuration, learn more in the [logging concept documentation](https://docs.stackable.tech/home/26.11/concepts/logging). properties: containers: description: Log configuration per container. @@ -1542,7 +1542,7 @@ spec: description: |- The `configOverrides` can be used to configure properties in product config files that are not exposed in the CRD. Read the - [config overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#config-overrides) + [config overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#config-overrides) and consult the operator specific usage guide documentation for details on the available config files and settings for the specific product. properties: @@ -1568,7 +1568,7 @@ spec: It is a map from environment variable names to their values. The names are validated to be valid environment variable names. Read the - [environment variable overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#env-overrides) + [environment variable overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#env-overrides) for more information and consult the operator specific usage guide to find out about the product specific environment variables that are available. type: object @@ -1579,7 +1579,7 @@ spec: removeRegex: [] description: |- Allows overriding JVM arguments. - Please read on the [JVM argument overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#jvm-argument-overrides) + Please read on the [JVM argument overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#jvm-argument-overrides) for details on the usage. properties: add: @@ -1608,7 +1608,7 @@ spec: [PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podtemplatespec-v1-core) to override any property that can be set on a Kubernetes Pod. Read the - [Pod overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#pod-overrides) + [Pod overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#pod-overrides) for more information. type: object x-kubernetes-preserve-unknown-fields: true @@ -1630,7 +1630,7 @@ spec: 2. The allowed number of Pods to be unavailable (`maxUnavailable`) Learn more in the - [allowed Pod disruptions documentation](https://docs.stackable.tech/home/nightly/concepts/operations/pod_disruptions). + [allowed Pod disruptions documentation](https://docs.stackable.tech/home/26.11/concepts/operations/pod_disruptions). properties: enabled: default: true @@ -1670,7 +1670,7 @@ spec: podAntiAffinity: null description: |- These configuration settings control - [Pod placement](https://docs.stackable.tech/home/nightly/concepts/operations/pod_placement). + [Pod placement](https://docs.stackable.tech/home/26.11/concepts/operations/pod_placement). properties: nodeAffinity: description: Same as the `spec.affinity.nodeAffinity` field on the Pod, see the [Kubernetes docs](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node) @@ -1702,7 +1702,7 @@ spec: default: containers: {} enableVectorAgent: null - description: Logging configuration, learn more in the [logging concept documentation](https://docs.stackable.tech/home/nightly/concepts/logging). + description: Logging configuration, learn more in the [logging concept documentation](https://docs.stackable.tech/home/26.11/concepts/logging). properties: containers: description: Log configuration per container. @@ -1984,7 +1984,7 @@ spec: description: |- The `configOverrides` can be used to configure properties in product config files that are not exposed in the CRD. Read the - [config overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#config-overrides) + [config overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#config-overrides) and consult the operator specific usage guide documentation for details on the available config files and settings for the specific product. properties: @@ -2010,7 +2010,7 @@ spec: It is a map from environment variable names to their values. The names are validated to be valid environment variable names. Read the - [environment variable overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#env-overrides) + [environment variable overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#env-overrides) for more information and consult the operator specific usage guide to find out about the product specific environment variables that are available. type: object @@ -2021,7 +2021,7 @@ spec: removeRegex: [] description: |- Allows overriding JVM arguments. - Please read on the [JVM argument overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#jvm-argument-overrides) + Please read on the [JVM argument overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#jvm-argument-overrides) for details on the usage. properties: add: @@ -2050,7 +2050,7 @@ spec: [PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podtemplatespec-v1-core) to override any property that can be set on a Kubernetes Pod. Read the - [Pod overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#pod-overrides) + [Pod overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#pod-overrides) for more information. type: object x-kubernetes-preserve-unknown-fields: true @@ -2074,7 +2074,7 @@ spec: names it `default`. Read the - [roles and role groups concept documentation](https://docs.stackable.tech/home/nightly/concepts/roles-and-role-groups) + [roles and role groups concept documentation](https://docs.stackable.tech/home/26.11/concepts/roles-and-role-groups) for more details. type: object required: @@ -2092,7 +2092,7 @@ spec: You can also configure a custom image registry to pull from, as well as completely custom images. - Consult the [Product image selection documentation](https://docs.stackable.tech/home/nightly/concepts/product_image_selection) + Consult the [Product image selection documentation](https://docs.stackable.tech/home/26.11/concepts/product_image_selection) for details. properties: custom: @@ -2187,7 +2187,7 @@ spec: List entries are arbitrary YAML objects, which need to be valid Kubernetes objects. - Read the [Object overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#object-overrides) + Read the [Object overrides documentation](https://docs.stackable.tech/home/26.11/concepts/overrides#object-overrides) for more information. items: type: object diff --git a/tests/release.yaml b/tests/release.yaml index 981efdf36..d27688a7c 100644 --- a/tests/release.yaml +++ b/tests/release.yaml @@ -7,14 +7,14 @@ releases: description: Integration test products: commons: - operatorVersion: 0.0.0-dev + operatorVersion: 26.11.0-rc1 secret: - operatorVersion: 0.0.0-dev + operatorVersion: 26.11.0-rc1 listener: - operatorVersion: 0.0.0-dev + operatorVersion: 26.11.0-rc1 zookeeper: - operatorVersion: 0.0.0-dev + operatorVersion: 26.11.0-rc1 kafka: - operatorVersion: 0.0.0-dev + operatorVersion: 26.11.0-rc1 opa: - operatorVersion: 0.0.0-dev + operatorVersion: 26.11.0-rc1 diff --git a/tests/templates/kuttl/smoke-kraft/33-assert.yaml.j2 b/tests/templates/kuttl/smoke-kraft/33-assert.yaml.j2 index f0876558c..2de841f8b 100644 --- a/tests/templates/kuttl/smoke-kraft/33-assert.yaml.j2 +++ b/tests/templates/kuttl/smoke-kraft/33-assert.yaml.j2 @@ -46,7 +46,7 @@ metadata: app.kubernetes.io/instance: test-kafka app.kubernetes.io/managed-by: kafka.stackable.tech_kafkacluster app.kubernetes.io/name: kafka - app.kubernetes.io/version: "{{ test_scenario['values']['kafka-kraft'].split(',')[0] }}-stackable0.0.0-dev" + app.kubernetes.io/version: "{{ test_scenario['values']['kafka-kraft'].split(',')[0] }}-stackable26.11.0-rc1" stackable.tech/vendor: Stackable ownerReferences: - apiVersion: kafka.stackable.tech/v1alpha1 diff --git a/tests/templates/kuttl/smoke/34-assert.yaml.j2 b/tests/templates/kuttl/smoke/34-assert.yaml.j2 index 58c8db572..e65b7903e 100644 --- a/tests/templates/kuttl/smoke/34-assert.yaml.j2 +++ b/tests/templates/kuttl/smoke/34-assert.yaml.j2 @@ -504,7 +504,7 @@ metadata: app.kubernetes.io/instance: test-kafka app.kubernetes.io/managed-by: kafka.stackable.tech_kafkacluster app.kubernetes.io/name: kafka - app.kubernetes.io/version: "{{ test_scenario['values']['kafka'].split(',')[0] }}-stackable0.0.0-dev" + app.kubernetes.io/version: "{{ test_scenario['values']['kafka'].split(',')[0] }}-stackable26.11.0-rc1" stackable.tech/vendor: Stackable ownerReferences: - apiVersion: kafka.stackable.tech/v1alpha1 diff --git a/tests/templates/kuttl/upgrade/04-assert.yaml.j2 b/tests/templates/kuttl/upgrade/04-assert.yaml.j2 index bc149a357..97e16d66a 100644 --- a/tests/templates/kuttl/upgrade/04-assert.yaml.j2 +++ b/tests/templates/kuttl/upgrade/04-assert.yaml.j2 @@ -8,7 +8,7 @@ kind: StatefulSet metadata: name: test-kafka-broker-default labels: - app.kubernetes.io/version: "{{ test_scenario['values']['upgrade_new'] }}-stackable0.0.0-dev" + app.kubernetes.io/version: "{{ test_scenario['values']['upgrade_new'] }}-stackable26.11.0-rc1" status: readyReplicas: 1 replicas: 1 @@ -20,7 +20,7 @@ kind: StatefulSet metadata: name: test-kafka-controller-default labels: - app.kubernetes.io/version: "{{ test_scenario['values']['upgrade_new'] }}-stackable0.0.0-dev" + app.kubernetes.io/version: "{{ test_scenario['values']['upgrade_new'] }}-stackable26.11.0-rc1" status: readyReplicas: 1 replicas: 1 From 2b2225d358ed50231aa74d1a3b7b1a8a8ce1ab96 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 19 Nov 2026 15:00:42 +0000 Subject: [PATCH 2/2] fix: KRaft migration needs bootstrap controller id in ZK mode too (#1073) * docs: KRaft migration guide updated and improved * fix: KRaft migration needs bootstrap controller id in ZK mode too * update changelog * review: timeline clarification in docs --- CHANGELOG.md | 5 +- .../examples/kraft_migration/01-setup.yaml | 11 -- .../pages/usage-guide/kraft-controller.adoc | 159 ++++++++++++++---- .../src/controller/validate.rs | 59 ++++++- 4 files changed, 184 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2afc806a0..ae7b63c10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,7 @@ All notable changes to this project will be documented in this file. - New status field `status.kraftBootstrapControllerNodeId` that records the KRaft controller that bootstrapped the quorum. Previously a new controller role group would create a second quorum and thus make the cluster unusable. A node ID hash collision between role groups is now reported during - validation, also in ZooKeeper mode ([#1061]). + validation, also in ZooKeeper mode ([#1061], [#1073]). ### Changed @@ -79,6 +79,8 @@ All notable changes to this project will be documented in this file. - The `/ready` endpoint of the operator now also waits for the KafkaTopic CRD. If the CRDs are not maintained by the operator (`maintenance.customResourceDefinitions.maintain: false`), install the KafkaTopic CRD together with the KafkaCluster CRD ([#1050]). +- docs: The ZooKeeper to KRaft migration guide was validated against the current operator and + corrected ([#1073]). ### Fixed @@ -137,6 +139,7 @@ All notable changes to this project will be documented in this file. [#1055]: https://github.com/stackabletech/kafka-operator/pull/1055 [#1061]: https://github.com/stackabletech/kafka-operator/pull/1061 [#1069]: https://github.com/stackabletech/kafka-operator/pull/1069 +[#1073]: https://github.com/stackabletech/kafka-operator/pull/1073 ## [26.7.0] - 2026-07-21 diff --git a/docs/modules/kafka/examples/kraft_migration/01-setup.yaml b/docs/modules/kafka/examples/kraft_migration/01-setup.yaml index f038f30bf..91cdbabb0 100644 --- a/docs/modules/kafka/examples/kraft_migration/01-setup.yaml +++ b/docs/modules/kafka/examples/kraft_migration/01-setup.yaml @@ -64,16 +64,6 @@ spec: namespace: kraft-migration autoGenerate: true --- -apiVersion: v1 -kind: ConfigMap -metadata: - name: broker-ids - namespace: kraft-migration -data: - simple-kafka-broker-default-0: "2000" - simple-kafka-broker-default-1: "2001" - simple-kafka-broker-default-2: "2002" ---- apiVersion: kafka.stackable.tech/v1alpha1 kind: KafkaCluster metadata: @@ -85,7 +75,6 @@ spec: pullPolicy: IfNotPresent clusterConfig: metadataManager: ZooKeeper - brokerIdPodConfigMapName: broker-ids authentication: - authenticationClass: kafka-client-auth-tls tls: diff --git a/docs/modules/kafka/pages/usage-guide/kraft-controller.adoc b/docs/modules/kafka/pages/usage-guide/kraft-controller.adoc index 1cf7d47c1..b8ab39e0c 100644 --- a/docs/modules/kafka/pages/usage-guide/kraft-controller.adoc +++ b/docs/modules/kafka/pages/usage-guide/kraft-controller.adoc @@ -154,14 +154,42 @@ This guide describes the steps required to migrate an existing Kafka cluster man NOTE: Before starting the migration we recommend to reduce producer/consumer operations to a minimum or even pause them completely if possible to reduce the risk of data loss during the migration. To make the migration step as clear as possible, we'll use a complete working example throughout this guide. -The example cluster will be kept minimal without any additional configuration. +The example cluster has one ZooKeeper server and three brokers, uses default resources and a single role group, and is secured as follows: + +* Clients authenticate with TLS client certificates, using an `AuthenticationClass` with the TLS provider (`spec.clusterConfig.authentication`). +* Traffic between the Kafka nodes is encrypted with the `internalSecretClass` `kafka-internal-tls`, and the client-facing listeners with the `tls` `SecretClass` (`serverSecretClass`). +* Neither Kerberos nor OPA is used. + +The example manifests set no other configuration besides what the migration requires. + +[IMPORTANT] +==== +The steps in this guide were only validated for the example above. +In particular, the interaction of the migration with Kerberos and OPA was *not* tested. +If your cluster uses either of them, check the following points before you start and test the migration on a non-production copy of your cluster first. + +Client authentication:: +The authentication method of the clients does not change during the migration. +The `CONTROLLER` listener is not affected by it: the controllers and brokers always authenticate each other with the certificates of the `internalSecretClass`, whatever `spec.clusterConfig.authentication` is set to. +Keep `spec.clusterConfig.authentication` and `spec.clusterConfig.tls` unchanged in every step, as the example manifests do. + +Kerberos:: +Kerberos is only used on the client-facing listeners of the brokers. +The controllers do not use Kerberos and have no keytab, so no Kerberos configuration is needed for them. +With Kerberos enabled, the example manifests have not been validated, in particular the broker `configOverrides` in steps 3 and 4. +See xref:usage-guide/security.adoc[Security] for the broker-side Kerberos setup. + +OPA:: +When `spec.clusterConfig.authorization.opa` is set, the operator configures the OPA authorizer on the controllers too, and the Rego rules also authorize the requests between the Kafka nodes (see xref:usage-guide/security.adoc[Security]). +The controllers you add in step 2 are therefore subject to your Rego rules from the moment they start, and they must be allowed to act as controllers, otherwise the quorum cannot form or the metadata migration fails. +The example does not set up OPA, so this has not been validated. +==== We'll use Kafka version `3.9.2` for this purpose. This is because this is the last version from the 3.x Kafka series that runs on ZooKeeper mode and is supported by the SDP. -We'll also assign broker ids manually from the beginning to simplify this guide. -In a real-world scenario, you do not have this option at cluster creation because your cluster is already running. -Instead, you'll have to collect these ids from the running cluster and configure manual assignment as part of step 1 below. +Like any cluster that was set up before the migration was planned, the example cluster does not configure its broker ids. +Kafka generated them when the brokers first started, and step 1 below shows how to collect and pin them. We start by creating a dedicated namespace to work in and deploy the Kafka cluster including ZooKeeper and credentials. @@ -197,39 +225,104 @@ $ /stackable/kafka/bin/kafka-producer-perf-test.sh \ We now have a working Kafka cluster with ZooKeeper and some test data. -=== 1. Start Kraft controllers +=== 1. Preserve the broker ids + +Before KRaft support was added to the operator in SDP 25.11.0, Kafka generated the broker ids and the operator did not know them. +In KRaft mode, the id of a broker is its `node.id`, which must be the same id that is already stored in the broker's data directory and in the cluster metadata. +The operator can only keep the existing ids if you tell it what they are, so this has to be done before anything else. In this step we will perform the following actions: -1. Retrieve the current `cluster.id` as generated by Kafka. -2. Retrieve and store the current broker ids. -3. Update the `KafkaCluster` resource to add `spec.controllers` property. -4. Configure the controllers to run in migration mode. -5. Apply the changes and wait for all cluster pods to become ready. +1. Collect the current broker ids from the running brokers. +2. Store them in a ConfigMap. +3. Point `spec.clusterConfig.brokerIdPodConfigMapName` of the `KafkaCluster` resource to this ConfigMap. +4. Wait for the brokers to restart and verify that their ids did not change. -We can obtain the current `cluster.id` either by inspecting the ZooKeeper data or from `meta.properties` file on one of the brokers. +Each broker records its id in the `meta.properties` file in its data directory: [source,bash] ---- -$ kubectl -n kraft-migration exec -c kafka simple-kafka-broker-default-0 -- cat /stackable/data/topicdata/meta.properties | grep cluster.id -cluster.id=MyCya7hbTD-Hay8PgCsCYA +$ kubectl -n kraft-migration exec -c kafka simple-kafka-broker-default-0 -- grep broker.id /stackable/data/topicdata/meta.properties +broker.id=1001 ---- -We add this value to the `KAFKA_CLUSTER_ID` environment variable for both brokers and controllers. +The ids that Kafka generates usually start at `1001`, and they are not necessarily in the order of the pod indexes. +The following commands collect the id of every broker Pod, of all role groups, and create a ConfigMap with one `: ` entry per Pod: + +[source,bash] +---- +NAMESPACE=kraft-migration +ARGS=() +for POD in $(kubectl get pods -n $NAMESPACE \ + -l app.kubernetes.io/name=kafka,app.kubernetes.io/instance=simple-kafka,app.kubernetes.io/component=broker \ + -o jsonpath='{.items[*].metadata.name}'); do + ID=$(kubectl exec -n $NAMESPACE -c kafka $POD -- grep '^broker.id=' /stackable/data/topicdata/meta.properties | cut -d= -f2) + echo "$POD -> $ID" + ARGS+=("--from-literal=$POD=$ID") +done +kubectl create configmap broker-ids -n $NAMESPACE "${ARGS[@]}" +---- + +The output lists the ids that were found: + +[source] +---- +simple-kafka-broker-default-0 -> 1001 +simple-kafka-broker-default-1 -> 1002 +simple-kafka-broker-default-2 -> 1003 +configmap/broker-ids created +---- + +Check that the ConfigMap contains an entry for every broker Pod before you continue. + +Now point the `KafkaCluster` to the ConfigMap. +Create the ConfigMap first, because the broker Pods mount it. -To be able to migrate the existing brokers, we need to preserve their broker ids. -Similarly to the cluster id, we can obtain the broker ids from the `meta.properties` file on each broker pod. +[source,bash] +---- +kubectl -n kraft-migration patch kafkacluster simple-kafka --type merge \ + -p '{"spec":{"clusterConfig":{"brokerIdPodConfigMapName":"broker-ids"}}}' +---- + +The operator restarts the brokers one after the other. +Once they are all ready, each broker must report the same id as before. +The `broker.id` in the configuration file of the broker must match the id in its `meta.properties`: [source,bash] ---- -$ kubectl -n kraft-migration exec -c kafka simple-kafka-broker-default-0 -- cat /stackable/data/topicdata/meta.properties | grep broker.id -broker.id=2000 +$ kubectl -n kraft-migration exec -c kafka simple-kafka-broker-default-0 -- grep broker.id /tmp/broker.properties +broker.id=1001 +broker.id.generation.enable=false ---- -We then need to inform the operator to use these ids instead of generating new ones. -This is done by creating a configmap map containing the id mapping and pointing the `spec.clusterProperties.brokerIdPodConfigMapName` property of the `KafkaCluster` resource to it. +The `brokerIdPodConfigMapName` property and the ConfigMap must be preserved for the lifetime of the cluster, also after the migration is complete. +The brokers keep using these ids in KRaft mode, and without the ConfigMap the operator would fall back to generated ids that do not match the ones already stored by the brokers. + +The following steps also contain this property in the `KafkaCluster` manifests. + +=== 2. Start Kraft controllers -These two properties must be preserved for the rest of the migration process and the lifetime of the cluster. +In this step we will perform the following actions: + +1. Retrieve the current `cluster.id` as generated by Kafka. +2. Update the `KafkaCluster` resource to add `spec.controllers` property. +3. Configure the controllers to run in migration mode. +4. Apply the changes and wait for all cluster pods to become ready. + +We can obtain the current `cluster.id` either by inspecting the ZooKeeper data or from `meta.properties` file on one of the brokers. + +[source,bash] +---- +$ kubectl -n kraft-migration exec -c kafka simple-kafka-broker-default-0 -- cat /stackable/data/topicdata/meta.properties | grep cluster.id +cluster.id=MyCya7hbTD-Hay8PgCsCYA +---- + +We add this value to the `KAFKA_CLUSTER_ID` environment variable for both brokers and controllers. +The cluster id is generated by Kafka for each cluster, so replace the value `MyCya7hbTD-Hay8PgCsCYA` in all the example manifests below with your own. + +The broker ids were already pinned in step 1 and `spec.clusterConfig.brokerIdPodConfigMapName` is part of the manifest below. + +The `KAFKA_CLUSTER_ID` environment variable and `brokerIdPodConfigMapName` must be preserved for the rest of the migration process and the lifetime of the cluster. The complete example `KafkaCluster` resource after applying the required changes looks as follows: @@ -240,7 +333,7 @@ include::example$kraft_migration/02-start-controllers.yaml[] We `kubectl apply` the updated resource and wait for brokers and controllers to become ready. -=== 2. Migrate metadata +=== 3. Migrate metadata In this step we will perform the following actions: @@ -268,10 +361,13 @@ kubectl logs -n kraft-migration simple-kafka-controller-default-0 | grep -i 'com || kubectl logs -n kraft-migration simple-kafka-controller-default-2 | grep -i 'completed migration' ... -[2025-12-22 09:23:53,372] INFO [KRaftMigrationDriver id=2110489705] Completed migration of metadata from ZooKeeper to KRaft. 0 records were generated in 102 ms across 0 batches. The average time spent waiting on a batch was -1.00 ms. The record types were {}. The current metadata offset is now 280 with an epoch of 3. Saw 0 brokers in the migrated metadata []. (org.apache.kafka.metadata.migration.KRaftMigrationDriver) +[2026-11-19 11:02:00,532] INFO [KRaftMigrationDriver id=2110489703] Completed migration of metadata from ZooKeeper to KRaft. 59 records were generated in 111 ms across 1 batches. The average time spent waiting on a batch was 28.00 ms. The record types were {TOPIC_RECORD=2, PARTITION_RECORD=53, CONFIG_RECORD=3, PRODUCER_IDS_RECORD=1}. The current metadata offset is now 452 with an epoch of 1. Saw 3 brokers in the migrated metadata [1001, 1002, 1003]. (org.apache.kafka.metadata.migration.KRaftMigrationDriver) ---- -=== 3. Migrate brokers +The exact counts depend on the topics and brokers of your cluster. +Only the controller that leads the quorum logs this message, hence the `||` chain above. + +=== 4. Migrate brokers NOTE: This is the last step before fully switching to KRaft mode. In case of unforeseen issues, it is the last step where we can roll back to ZooKeeper mode. @@ -292,7 +388,7 @@ For this step, the complete example `KafkaCluster` resource looks as follows: include::example$kraft_migration/04-migrate-brokers.yaml[] ---- -=== 4. Enable Kraft mode +=== 5. Enable Kraft mode After this step, the cluster will be fully running in KRaft mode and it cannot be rolled back to ZooKeeper mode anymore. @@ -322,12 +418,15 @@ We can consume the previously produced messages by running the command below on --consumer.config /stackable/config/client.properties \ --bootstrap-server simple-kafka-broker-default-0-listener-broker.kraft-migration.svc.cluster.local:9093 \ --topic kraft-migration-topic \ ---offset earliest \ ---partition 0 \ ---timeout-ms 10000 +--from-beginning \ +--max-messages 100 \ +--timeout-ms 30000 ---- -=== 5. Cleanup +The consumer should report `Processed a total of 100 messages`. +We read from all partitions because the producer does not necessarily write to partition 0. + +=== 6. Cleanup Before proceeding with this step please ensure that the Kafka cluster is fully operational in KRaft mode. @@ -343,6 +442,6 @@ kubectl delete -n kraft-migration zookeeperznodes simple-kafka-znode kubectl delete -n kraft-migration zookeeperclusters simple-zk ---- -=== 6. Next steps +=== 7. Next steps After successfully migrating to Kraft mode, consider updating to Kafka version 4 to benefit from the latest features and improvements in KRaft mode. diff --git a/rust/operator-binary/src/controller/validate.rs b/rust/operator-binary/src/controller/validate.rs index d78c2747b..76e131a5d 100644 --- a/rust/operator-binary/src/controller/validate.rs +++ b/rust/operator-binary/src/controller/validate.rs @@ -406,13 +406,13 @@ pub fn validate( let pod_node_ids = pod_node_ids(&broker_role_group_configs, &controller_role_group_configs) .context(PredictNodeIdsSnafu)?; - let kraft_bootstrap_controller = match metadata_manager { - crate::crd::MetadataManager::KRaft => resolve_kraft_bootstrap_controller( - dereferenced_objects.persisted_kraft_bootstrap_controller_node_id, - &pod_node_ids, - ), - _ => None, - }; + // Needs to be computed regardless of which metadata manager is used, + // to support the migration from ZooKeeper to KRaft. + // Clusters without controllers have no bootstrap controller. + let kraft_bootstrap_controller = resolve_kraft_bootstrap_controller( + dereferenced_objects.persisted_kraft_bootstrap_controller_node_id, + &pod_node_ids, + ); Ok(ValidatedCluster { metadata: ValidatedCluster::object_meta(&name, &namespace, &uid), @@ -1308,8 +1308,51 @@ mod tests { ); } + /// During a ZooKeeper to KRaft migration the cluster is still in ZooKeeper mode, but its + /// controllers must already form a quorum, so one of them has to bootstrap it. + #[test] + fn kraft_bootstrap_controller_is_chosen_in_zookeeper_mode_with_controllers() { + let kafka = minimal_kafka( + r#" + apiVersion: kafka.stackable.tech/v1alpha1 + kind: KafkaCluster + metadata: + name: simple-kafka + namespace: default + uid: 12345678-1234-1234-1234-123456789012 + spec: + image: + productVersion: 3.9.2 + clusterConfig: + metadataManager: ZooKeeper + zookeeperConfigMapName: xyz + brokers: + roleGroups: + default: + replicas: 1 + controllers: + roleGroups: + default: + replicas: 3 + "#, + ); + + let new_cluster = validated_cluster_with_persisted_kraft_bootstrap(&kafka, None); + assert!(matches!( + new_cluster.kraft_bootstrap_controller, + Some(KraftBootstrapController::New(_)) + )); + + let persisted_cluster = + validated_cluster_with_persisted_kraft_bootstrap(&kafka, Some(2110489703)); + assert_eq!( + persisted_cluster.kraft_bootstrap_controller, + Some(KraftBootstrapController::Persisted(2110489703)) + ); + } + #[test] - fn kraft_bootstrap_controller_is_none_in_zookeeper_mode() { + fn kraft_bootstrap_controller_is_none_in_zookeeper_mode_without_controllers() { let kafka = minimal_kafka( r#" apiVersion: kafka.stackable.tech/v1alpha1