5.4. Streams for Apache Kafka
5.4.1. Support for automatic rebalancing 复制链接链接已复制到粘贴板!
You can scale a Kafka cluster by adjusting the number of brokers using the spec.replicas property in the Kafka or KafkaNodePool custom resource used in deployment.
Enable auto-rebalancing to automatically redistribute topic partitions when scaling a cluster up or down. Auto-rebalancing requires a Cruise Control deployment, a rebalancing template for the operation, and autorebalance configuration in the Kafka resource referencing the template. When enabled, auto-rebalancing rebalances clusters that have been scaled up or down without further intervention.
- After scaling up, auto-rebalancing redistributes some existing partitions to the newly added brokers.
- Before scaling down, if the brokers to be removed host partitions, the operator triggers auto-rebalancing to move the partitions, freeing the brokers for removal.
For more information, see Triggering auto-rebalances when scaling clusters.
If you are using JBOD storage and have Cruise Control installed with Streams for Apache Kafka, you can now reassign partitions between the JBOD disks used for storage on the same broker. This capability also allows you to remove JBOD disks without data loss.
You configure a KafkaRebalance resource in remove-disks mode and specify a list of broker IDs with corresponding volume IDs for partition reassignment. Cruise Control generates an optimization proposal based on the configuration and reassigns the partitions when approved manually or automatically.
For more information, see Using Cruise Control to reassign partitions on JBOD disks.
5.4.3. Mechanism to manage connector offsets 复制链接链接已复制到粘贴板!
A new mechanism allows connector offsets to be managed through KafkaConnect and KafkaMirrorMaker2 resources. It’s now possible to list, alter, and reset offsets.
For more information, see Configuring Kafka Connect connectors.
5.4.4. Templates for host and advertisedHost properties 复制链接链接已复制到粘贴板!
Hostnames and advertised hostnames for individual brokers can be specified using the host and advertisedHost properties. This release introduces support for using variables, such as {nodeId} or {nodePodName}, in the following templates:
-
advertisedHostTemplate -
hostTemplate
By using templates, you no longer need to configure each broker individually. Streams for Apache Kafka automatically replaces the template variables with the corresponding values for each broker.
For more information, see Overriding advertised addresses for brokers and Specifying listener types.
Environment variables for any container deployed by Streams for Apache Kafka may now be based on values specified in a Secret or ConfigMap. This replaces the requirement to use the ExternalConfiguration schema for Kafka Connect and MirrorMaker 2 containers, which is now deprecated.
Values are referenced in the container configuration using the valueFrom.secretKeyRef or valueFrom.configMapKeyRef properties.
For more information, see Loading configuration values from environment variables.
5.4.6. Disabling pod disruption budget generation 复制链接链接已复制到粘贴板!
Strimzi generates pod disruption budget resources for Kafka, Kafka Connect worker, MirrorMaker2 worker, and Kafka Bridge worker nodes.
If you want to use custom pod disruption budget resources, you can now set the STRIMZI_POD_DISRUPTION_BUDGET_GENERATION environment variable to false in the Cluster Operator configuration.
For more information, see Disabling pod disruption budget generation.
5.4.7. Support for CSI volumes in templates 复制链接链接已复制到粘贴板!
In order to support the CSI volumes, a new property named csi has been added to the AdditionalVolume schema. This property maps to the Kubernetes API CSIVolumeSource structure, allowing CSI volumes to be defined in container template fields.
For more information, see AdditionalVolume schema reference and Additional volumes.