Skip to content

Remove the KRaft and NodePool annotations #11686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 24, 2025

Conversation

scholzj
Copy link
Member

@scholzj scholzj commented Jul 23, 2025

Type of change

  • Task

Description

As discussed in #11657, there seems to be consensus to stop enforcing the strimzi.io/node-pools and strimzi.io/kraft annotations. This PR removes them from the docs, examples, and from source code. The only place where they remain are the upgrade/downgrade system tests. They should be removed from there only once we do not use them with any Strimzi version enforcing them.

This PR - assuming it is approved and merged - should make #11657 obsolete.

There is no real need for users to remove the annotations - they will be simply ignored.

The validation for pre-existing ZooKeeper-based clusters still remains in place. So if user upgrades without migrating all their clusters to KRaft, they should get error like this:

2025-07-23 19:51:52 WARN  AbstractOperator:566 - Reconciliation #1(watch) Kafka(myproject/my-cluster): Failed to reconcile
io.strimzi.operator.common.InvalidConfigurationException: Strimzi 0.48.0-SNAPSHOT supports only KRaft-based Apache Kafka clusters. Please make sure your cluster is migrated to KRaft before using Strimzi 0.48.0-SNAPSHOT.
	at io.strimzi.operator.cluster.operator.assembly.KafkaAssemblyOperator.reconcile(KafkaAssemblyOperator.java:228) ~[io.strimzi.cluster-operator-0.48.0-SNAPSHOT.jar:0.48.0-SNAPSHOT]
	at io.strimzi.operator.cluster.operator.assembly.KafkaAssemblyOperator.createOrUpdate(KafkaAssemblyOperator.java:141) ~[io.strimzi.cluster-operator-0.48.0-SNAPSHOT.jar:0.48.0-SNAPSHOT]
	at io.strimzi.operator.cluster.operator.assembly.KafkaAssemblyOperator.createOrUpdate(KafkaAssemblyOperator.java:71) ~[io.strimzi.cluster-operator-0.48.0-SNAPSHOT.jar:0.48.0-SNAPSHOT]
	at io.strimzi.operator.cluster.operator.assembly.AbstractOperator.reconcileResource(AbstractOperator.java:268) ~[io.strimzi.cluster-operator-0.48.0-SNAPSHOT.jar:0.48.0-SNAPSHOT]
	at io.strimzi.operator.cluster.operator.assembly.AbstractOperator.lambda$reconcile$0(AbstractOperator.java:191) ~[io.strimzi.cluster-operator-0.48.0-SNAPSHOT.jar:0.48.0-SNAPSHOT]
	at io.vertx.core.impl.future.Composition.complete(Composition.java:40) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.FutureBase.lambda$emitResult$0(FutureBase.java:59) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:148) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:141) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:507) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:182) ~[io.netty.netty-transport-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1073) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]

Similarly, the operator still validates the presence of the Node Pools. So if user tries to deploy a ZooKeeper-based cluster without node pool based on an old example, they still get this error:

2025-07-23 19:25:15 ERROR AbstractOperator:285 - Reconciliation #77(watch) Kafka(myproject/my-cluster): createOrUpdate failed
io.strimzi.operator.common.InvalidConfigurationException: No KafkaNodePools found for Kafka cluster my-cluster
	at io.strimzi.operator.cluster.operator.assembly.KafkaAssemblyOperator$ReconciliationState.lambda$kafkaReconciler$6(KafkaAssemblyOperator.java:507) ~[io.strimzi.cluster-operator-0.48.0-SNAPSHOT.jar:0.48.0-SNAPSHOT]
	at io.vertx.core.impl.future.Composition.complete(Composition.java:40) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.FutureBase.emitResult(FutureBase.java:68) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.FutureImpl.completeInternal(FutureImpl.java:163) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:169) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.CompositeFutureImpl.doComplete(CompositeFutureImpl.java:218) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.CompositeFutureImpl.onSuccess(CompositeFutureImpl.java:123) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.CompositeFutureImpl.complete(CompositeFutureImpl.java:85) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.FutureBase.lambda$emitResult$0(FutureBase.java:59) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:148) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:141) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:507) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:182) ~[io.netty.netty-transport-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1073) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]

We also keep validating the presence of controller nodes. So YAML for an ols Zoo-based cluster without controller nodes would also fail with the corresponding error:

2025-07-23 19:28:01 ERROR AbstractOperator:285 - Reconciliation #82(watch) Kafka(myproject/my-cluster): createOrUpdate failed
io.strimzi.operator.common.model.InvalidResourceException: The Kafka cluster my-cluster is invalid: [At least one KafkaNodePool with the controller role and at least one replica is required when KRaft mode is enabled]
	at io.strimzi.operator.cluster.model.nodepools.NodePoolUtils.validateNodePools(NodePoolUtils.java:107) ~[io.strimzi.cluster-operator-0.48.0-SNAPSHOT.jar:0.48.0-SNAPSHOT]
	at io.strimzi.operator.cluster.model.nodepools.NodePoolUtils.createKafkaPools(NodePoolUtils.java:56) ~[io.strimzi.cluster-operator-0.48.0-SNAPSHOT.jar:0.48.0-SNAPSHOT]
	at io.strimzi.operator.cluster.operator.assembly.KafkaClusterCreator.createKafkaCluster(KafkaClusterCreator.java:330) ~[io.strimzi.cluster-operator-0.48.0-SNAPSHOT.jar:0.48.0-SNAPSHOT]
	at io.strimzi.operator.cluster.operator.assembly.KafkaClusterCreator.createKafkaCluster(KafkaClusterCreator.java:166) ~[io.strimzi.cluster-operator-0.48.0-SNAPSHOT.jar:0.48.0-SNAPSHOT]
	at io.strimzi.operator.cluster.operator.assembly.KafkaClusterCreator.prepareKafkaCluster(KafkaClusterCreator.java:114) ~[io.strimzi.cluster-operator-0.48.0-SNAPSHOT.jar:0.48.0-SNAPSHOT]
	at io.strimzi.operator.cluster.operator.assembly.KafkaAssemblyOperator$ReconciliationState.lambda$kafkaReconciler$6(KafkaAssemblyOperator.java:522) ~[io.strimzi.cluster-operator-0.48.0-SNAPSHOT.jar:0.48.0-SNAPSHOT]
	at io.vertx.core.impl.future.Composition.complete(Composition.java:40) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.FutureBase.emitResult(FutureBase.java:68) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.FutureImpl.completeInternal(FutureImpl.java:163) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:169) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.CompositeFutureImpl.doComplete(CompositeFutureImpl.java:218) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.CompositeFutureImpl.onSuccess(CompositeFutureImpl.java:123) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.CompositeFutureImpl.complete(CompositeFutureImpl.java:85) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.vertx.core.impl.future.FutureBase.lambda$emitResult$0(FutureBase.java:59) ~[io.vertx.vertx-core-5.0.1.jar:5.0.1]
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:148) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:141) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:507) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:182) ~[io.netty.netty-transport-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1073) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty.netty-common-4.2.2.Final.jar:4.2.2.Final]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]

Checklist

  • Make sure all tests pass
  • Update documentation
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md

Signed-off-by: Jakub Scholz <www@scholzj.com>
@scholzj
Copy link
Member Author

scholzj commented Jul 23, 2025

/azp run upgrade

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj
Copy link
Member Author

scholzj commented Jul 23, 2025

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj
Copy link
Member Author

scholzj commented Jul 23, 2025

/packit test --labels upgrade,regression

Copy link
Member

@im-konge im-konge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

Copy link
Member

@see-quick see-quick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 just one nit to consider.

@@ -331,6 +331,8 @@ protected void deployKafkaClusterWithWaitForReadiness(final String componentsNam
KafkaNodePoolTemplates.brokerPoolPersistentStorage(componentsNamespaceName, BROKER_NODE_NAME, CLUSTER_NAME, 3).build(),
KafkaTemplates.kafka(componentsNamespaceName, CLUSTER_NAME, 3)
.editMetadata()
// This is still needed for upgrade tests. It should be remove once the upgrade tests use
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe here same TODO: so it's easier to find?

@@ -105,6 +105,8 @@ public class ResourceAnnotations {
* Annotation for enabling or disabling the Node Pools. This annotation is used
* on the Kafka CR
*/
// This is still needed for upgrade tests. It should be remove once the upgrade tests use
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a TODO: prefix here, rather than just comment?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about opening an issue to track it and adding the issue link here. We did this in the past more times.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will open an issue and reference it here. But I did not want to do it before we had the approvals.

Copy link
Member

@ppatierno ppatierno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. A couple of nits.

CHANGELOG.md Outdated
@@ -2,7 +2,8 @@

## 0.48.0

* n/a
* KRaft and Kafka Node Pools are now enabled by default.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* KRaft and Kafka Node Pools are now enabled by default.
* KRaft mode and Kafka Node Pools are now enabled by default.

@@ -105,6 +105,8 @@ public class ResourceAnnotations {
* Annotation for enabling or disabling the Node Pools. This annotation is used
* on the Kafka CR
*/
// This is still needed for upgrade tests. It should be remove once the upgrade tests use
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about opening an issue to track it and adding the issue link here. We did this in the past more times.

Signed-off-by: Jakub Scholz <www@scholzj.com>
@scholzj scholzj merged commit 024cdf0 into strimzi:main Jul 24, 2025
13 checks passed
@scholzj scholzj deleted the remove-kraft-and-nodepool-annotations branch July 24, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants