Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 8. Feature gates
Streams for Apache Kafka operators use feature gates to enable or disable specific features and functions. Enabling a feature gate alters the behavior of the associated operator, introducing the corresponding feature to your Streams for Apache Kafka deployment.
The purpose of feature gates is to facilitate the trial and testing of a feature before it is fully adopted. The state (enabled or disabled) of a feature gate may vary by default, depending on its maturity level.
As a feature gate graduates and reaches General Availability (GA), it transitions to an enabled state by default and becomes a permanent part of the Streams for Apache Kafka deployment. A feature gate at the GA stage cannot be disabled.
The supported feature gates are applicable to all Streams for Apache Kafka operators. While a particular feature gate might be used by one operator and ignored by the others, it can still be configured in all operators. When deploying the User Operator and Topic Operator within the context of the`Kafka` custom resource, the Cluster Operator automatically propagates the feature gates configuration to them. When the User Operator and Topic Operator are deployed standalone, without a Cluster Operator available to configure the feature gates, they must be directly configured within their deployments.
8.1. Graduated feature gates (GA) Copier lienLien copié sur presse-papiers!
Graduated feature gates have reached General Availability (GA) and are permanently enabled features.
8.1.1. ControlPlaneListener feature gate Copier lienLien copié sur presse-papiers!
The ControlPlaneListener
feature gate separates listeners for data replication and coordination:
- Connections between the Kafka controller and brokers use an internal control plane listener on port 9090.
- Replication of data between brokers, as well as internal connections from Streams for Apache Kafka operators, Cruise Control, or the Kafka Exporter use a replication listener on port 9091.
With the ControlPlaneListener
feature gate permanently enabled, direct upgrades or downgrades between Streams for Apache Kafka 1.7 and earlier and Streams for Apache Kafka 2.3 and newer are not possible. You must first upgrade or downgrade through one of the Streams for Apache Kafka versions in-between, disable the ControlPlaneListener
feature gate, and then downgrade or upgrade (with the feature gate enabled) to the target version.
8.1.2. ServiceAccountPatching feature gate Copier lienLien copié sur presse-papiers!
The ServiceAccountPatching
feature gate ensures that the Cluster Operator always reconciles service accounts and updates them when needed. For example, when you change service account labels or annotations using the template
property of a custom resource, the operator automatically updates them on the existing service account resources.
8.1.3. UseStrimziPodSets feature gate Copier lienLien copié sur presse-papiers!
The UseStrimziPodSets
feature gate introduced the StrimziPodSet
custom resource for managing Kafka and ZooKeeper pods, replacing the use of OpenShift StatefulSet
resources.
With the UseStrimziPodSets
feature gate permanently enabled, direct downgrades from Streams for Apache Kafka 2.5 and newer to Streams for Apache Kafka 2.0 or earlier are not possible. You must first downgrade through one of the Streams for Apache Kafka versions in-between, disable the UseStrimziPodSets
feature gate, and then downgrade to Streams for Apache Kafka 2.0 or earlier.
8.1.4. StableConnectIdentities feature gate Copier lienLien copié sur presse-papiers!
The StableConnectIdentities
feature gate introduced the StrimziPodSet
custom resource for managing Kafka Connect and Kafka MirrorMaker 2 pods, replacing the use of OpenShift Deployment
resources.
StrimziPodSet
resources give the pods stable names and stable addresses, which do not change during rolling upgrades, replacing the use of OpenShift Deployment
resources.
With the StableConnectIdentities
feature gate permanently enabled, direct downgrades from Streams for Apache Kafka 2.7 and newer to Streams for Apache Kafka 2.3 or earlier are not possible. You must first downgrade through one of the Streams for Apache Kafka versions in-between, disable the StableConnectIdentities
feature gate, and then downgrade to Streams for Apache Kafka 2.3 or earlier.
8.1.5. KafkaNodePools feature gate Copier lienLien copié sur presse-papiers!
The KafkaNodePools
feature gate introduced a new KafkaNodePool
custom resource that enables the configuration of different pools of Apache Kafka nodes.
A node pool refers to a distinct group of Kafka nodes within a Kafka cluster. Each pool has its own unique configuration, which includes mandatory settings such as the number of replicas, storage configuration, and a list of assigned roles. You can assign the controller role, broker role, or both roles to all nodes in the pool using the .spec.roles
property. When used with a ZooKeeper-based Apache Kafka cluster, it must be set to the broker
role. When used with a KRaft-based Apache Kafka cluster, it can be set to broker
, controller
, or both.
In addition, a node pool can have its own configuration of resource requests and limits, Java JVM options, and resource templates. Configuration options not set in the KafkaNodePool
resource are inherited from the Kafka
custom resource.
The KafkaNodePool
resources use a strimzi.io/cluster
label to indicate to which Kafka cluster they belong. The label must be set to the name of the Kafka
custom resource. The Kafka
resource configuration must also include the strimzi.io/node-pools: enabled
annotation, which is required when using node pools.
Examples of the KafkaNodePool
resources can be found in the example configuration files provided by Streams for Apache Kafka.
Downgrading from KafkaNodePools
If your cluster already uses KafkaNodePool
custom resources, and you wish to downgrade to an older version of Streams for Apache Kafka that does not support them or with the KafkaNodePools
feature gate disabled, you must first migrate from KafkaNodePool
custom resources to managing Kafka nodes using only Kafka
custom resources. For more information, see the instructions for reversing a migration to node pools.
8.1.6. UnidirectionalTopicOperator feature gate Copier lienLien copié sur presse-papiers!
The UnidirectionalTopicOperator
feature gate introduced a unidirectional topic management mode for creating Kafka topics using the KafkaTopic
resource. Unidirectional mode is compatible with using KRaft for cluster management. With unidirectional mode, you create Kafka topics using the KafkaTopic
resource, which are then managed by the Topic Operator. Any configuration changes to a topic outside the KafkaTopic
resource are reverted. For more information on topic management, see Section 10.1, “Topic management”.
8.1.7. UseKRaft feature gate Copier lienLien copié sur presse-papiers!
The UseKRaft
feature gate introduced the KRaft (Kafka Raft metadata) mode for running Apache Kafka clusters without ZooKeeper. ZooKeeper and KRaft are mechanisms used to manage metadata and coordinate operations in Kafka clusters. KRaft mode eliminates the need for an external coordination service like ZooKeeper. In KRaft mode, Kafka nodes take on the roles of brokers, controllers, or both. They collectively manage the metadata, which is replicated across partitions. Controllers are responsible for coordinating operations and maintaining the cluster’s state. For more information on using KRraft, see Chapter 5, Using Kafka in KRaft mode.
8.2. Stable feature gates (Beta) Copier lienLien copié sur presse-papiers!
Stable feature gates have reached a beta level of maturity, and are generally enabled by default for all users. Stable feature gates are production-ready, but they can still be disabled. Currently, there are no beta level feature gates.
8.3. Early access feature gates (Alpha) Copier lienLien copié sur presse-papiers!
Early access feature gates have not yet reached the beta stage, and are disabled by default. An early access feature gate provides an opportunity for assessment before its functionality is permanently incorporated into Streams for Apache Kafka.
8.3.1. ContinueReconciliationOnManualRollingUpdateFailure feature gate Copier lienLien copié sur presse-papiers!
The ContinueReconciliationOnManualRollingUpdateFailure
feature gate has a default state of disabled.
The ContinueReconciliationOnManualRollingUpdateFailure
feature gate allows the Cluster Operator to continue a reconciliation if the manual rolling update of the operands fails. It applies to the following operands that support manual rolling updates using the strimzi.io/manual-rolling-update
annotation:
- ZooKeeper
- Kafka
- Kafka Connect
- Kafka MirrorMaker 2
Continuing the reconciliation after a manual rolling update failure allows the operator to recover from various situations that might prevent the update from succeeding. For example, a missing Persistent Volume Claim (PVC) or Persistent Volume (PV) might cause the manual rolling update to fail. However, the PVCs and PVs are created only in a later stage of the reconciliation. By continuing the reconciliation after this failure, the process can recreate the missing PVC or PV and recover.
The ContinueReconciliationOnManualRollingUpdateFailure
feature gate is used by the Cluster Operator. It is ignored by the User and Topic Operators.
Enabling the ContinueReconciliationOnManualRollingUpdateFailure feature gate
To enable the ContinueReconciliationOnManualRollingUpdateFailure
feature gate, specify +ContinueReconciliationOnManualRollingUpdateFailure
in the STRIMZI_FEATURE_GATES
environment variable in the Cluster Operator configuration.
8.4. Enabling feature gates Copier lienLien copié sur presse-papiers!
To modify a feature gate’s default state, use the STRIMZI_FEATURE_GATES
environment variable in the operator’s configuration. You can modify multiple feature gates using this single environment variable. Specify a comma-separated list of feature gate names and prefixes. A +
prefix enables the feature gate and a -
prefix disables it.
Example feature gate configuration that enables FeatureGate1
and disables FeatureGate2
env: - name: STRIMZI_FEATURE_GATES value: +FeatureGate1,-FeatureGate2
env:
- name: STRIMZI_FEATURE_GATES
value: +FeatureGate1,-FeatureGate2
8.5. Feature gate releases Copier lienLien copié sur presse-papiers!
Feature gates have three stages of maturity:
- Alpha — typically disabled by default
- Beta — typically enabled by default
- General Availability (GA) — typically always enabled
Alpha stage features might be experimental or unstable, subject to change, or not sufficiently tested for production use. Beta stage features are well tested and their functionality is not likely to change. GA stage features are stable and should not change in the future. Alpha and beta stage features are removed if they do not prove to be useful.
-
The
ControlPlaneListener
feature gate moved to GA stage in Streams for Apache Kafka 2.3. It is now permanently enabled and cannot be disabled. -
The
ServiceAccountPatching
feature gate moved to GA stage in Streams for Apache Kafka 2.3. It is now permanently enabled and cannot be disabled. -
The
UseStrimziPodSets
feature gate moved to GA stage in Streams for Apache Kafka 2.5 and the support for StatefulSets is completely removed. It is now permanently enabled and cannot be disabled. -
The
StableConnectIdentities
feature gate moved to GA stage in Streams for Apache Kafka 2.7. It is now permanently enabled and cannot be disabled. -
The
KafkaNodePools
feature gate moved to GA stage in Streams for Apache Kafka 2.8. It is now permanently enabled and cannot be disabled. To useKafkaNodePool
resources, you still need to use thestrimzi.io/node-pools: enabled
annotation on theKafka
custom resources. -
The
UnidirectionalTopicOperator
feature gate moved to GA stage in Streams for Apache Kafka 2.8. It is now permanently enabled and cannot be disabled. -
The
UseKRaft
feature gate moved to GA stage in Streams for Apache Kafka 2.8. It is now permanently enabled and cannot be disabled. To use KRaft (ZooKeeper-less Apache Kafka), you still need to use thestrimzi.io/kraft: enabled
annotation on theKafka
custom resources or migrate from an existing ZooKeeper-based cluster. -
The
ContinueReconciliationOnManualRollingUpdateFailure
feature was introduced in Streams for Apache Kafka 2.8 and is disabled by default.
Feature gates might be removed when they reach GA. This means that the feature was incorporated into the Streams for Apache Kafka core features and can no longer be disabled.
Feature gate | Alpha | Beta | GA |
---|---|---|---|
| 1.8 | 2.0 | 2.3 |
| 1.8 | 2.0 | 2.3 |
| 2.1 | 2.3 | 2.5 |
| 2.2 | 2.7 | 2.8 |
| 2.4 | 2.6 | 2.7 |
| 2.5 | 2.7 | 2.8 |
| 2.5 | 2.7 | 2.8 |
| 2.8 | - | - |
If a feature gate is enabled, you may need to disable it before upgrading or downgrading from a specific Streams for Apache Kafka version (or first upgrade / downgrade to a version of Streams for Apache Kafka where it can be disabled). The following table shows which feature gates you need to disable when upgrading or downgrading Streams for Apache Kafka versions.
Disable Feature gate | Upgrading from Streams for Apache Kafka version | Downgrading to Streams for Apache Kafka version |
---|---|---|
| 1.7 and earlier | 1.7 and earlier |
| - | 2.0 and earlier |
| - | 2.3 and earlier |