strimzi / strimzi-kafka-operator

Apache Kafka® running on Kubernetes
https://strimzi.io/
Apache License 2.0
4.79k stars 1.28k forks source link

Use init container for Kafka nodes only when needed #10596

Closed scholzj closed 1 week ago

scholzj commented 2 weeks ago

Type of change

Description

Strimzi uses init container to gather additional information about the running Kafka node. This is done in two situations:

Right now, we configure the init container for all Kafka nodes. But it is really needed only for broker or mixed nodes. Controller-only nodes do not need it because:

This PR cleans up the code and configures the init container, the related volumes and volume mounts only when the node has the broker role. It does not affect the Cluster Role Binding to access the Kuberetes API because all Kafka nodes share the same service account.

I also decided to keep the affinity. While the rack does not need to be configured in the controller nodes, they should ideally be still distributed across the zones/racks and the best-effort affinity might help with it.

Checklist

scholzj commented 2 weeks ago

/azp run regression

azure-pipelines[bot] commented 2 weeks ago
Azure Pipelines successfully started running 1 pipeline(s).
scholzj commented 1 week ago

/azp run zookeeper-regression

azure-pipelines[bot] commented 1 week ago
Azure Pipelines successfully started running 1 pipeline(s).