Skip to content
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

Promote UnidirectionalTopicOperator feature gate to GA #9840

Merged
merged 12 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .azure/scripts/shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ topic-operator/scripts/*.sh
kafka-init/scripts/*.sh
docker-images/kafka-based/kafka/scripts/*.sh
docker-images/kafka-based/kafka/cruise-control-scripts/*.sh
docker-images/kafka-based/kafka/stunnel-scripts/*.sh
docker-images/kafka-based/kafka/exporter-scripts/*.sh
tools/*.sh"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
display_name: 'feature-gates-regression-bundle I. - kafka + oauth'
profile: 'azp_kafka_oauth'
cluster_operator_install_type: 'bundle'
strimzi_feature_gates: '-UnidirectionalTopicOperator,-UseKRaft'
strimzi_feature_gates: '-UseKRaft'
strimzi_use_node_pools_in_tests: "false"
timeout: 360
releaseVersion: '${{ parameters.releaseVersion }}'
Expand All @@ -17,7 +17,7 @@ jobs:
display_name: 'feature-gates-regression-bundle II. - security'
profile: 'azp_security'
cluster_operator_install_type: 'bundle'
strimzi_feature_gates: '-UnidirectionalTopicOperator,-UseKRaft'
strimzi_feature_gates: '-UseKRaft'
strimzi_use_node_pools_in_tests: "false"
timeout: 360
releaseVersion: '${{ parameters.releaseVersion }}'
Expand All @@ -29,7 +29,7 @@ jobs:
display_name: 'feature-gates-regression-bundle III. - dynconfig + tracing + watcher'
profile: 'azp_dynconfig_listeners_tracing_watcher'
cluster_operator_install_type: 'bundle'
strimzi_feature_gates: '-UnidirectionalTopicOperator,-UseKRaft'
strimzi_feature_gates: '-UseKRaft'
strimzi_use_node_pools_in_tests: "false"
timeout: 360
releaseVersion: '${{ parameters.releaseVersion }}'
Expand All @@ -41,7 +41,7 @@ jobs:
display_name: 'feature-gates-regression-bundle IV. - operators'
profile: 'azp_operators'
cluster_operator_install_type: 'bundle'
strimzi_feature_gates: '-UnidirectionalTopicOperator,-UseKRaft'
strimzi_feature_gates: '-UseKRaft'
strimzi_use_node_pools_in_tests: "false"
timeout: 360
releaseVersion: '${{ parameters.releaseVersion }}'
Expand All @@ -53,7 +53,7 @@ jobs:
display_name: 'feature-gates-regression-bundle V. - rollingupdate'
profile: 'azp_rolling_update_bridge'
cluster_operator_install_type: 'bundle'
strimzi_feature_gates: '-UnidirectionalTopicOperator,-UseKRaft'
strimzi_feature_gates: '-UseKRaft'
strimzi_use_node_pools_in_tests: "false"
timeout: 360
releaseVersion: '${{ parameters.releaseVersion }}'
Expand All @@ -65,7 +65,7 @@ jobs:
display_name: 'feature-gates-regression-bundle VI. - connect + mirrormaker'
profile: 'azp_connect_mirrormaker'
cluster_operator_install_type: 'bundle'
strimzi_feature_gates: '-UnidirectionalTopicOperator,-UseKRaft'
strimzi_feature_gates: '-UseKRaft'
strimzi_use_node_pools_in_tests: "false"
timeout: 360
releaseVersion: '${{ parameters.releaseVersion }}'
Expand All @@ -77,7 +77,7 @@ jobs:
display_name: 'feature-gates-regression-bundle VII. - remaining system tests'
profile: 'azp_remaining'
cluster_operator_install_type: 'bundle'
strimzi_feature_gates: '-UnidirectionalTopicOperator,-UseKRaft'
strimzi_feature_gates: '-UseKRaft'
strimzi_use_node_pools_in_tests: "false"
timeout: 360
releaseVersion: '${{ parameters.releaseVersion }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
cluster_operator_install_type: 'bundle'
timeout: 360
strimzi_rbac_scope: NAMESPACE
strimzi_feature_gates: '-UnidirectionalTopicOperator,-UseKRaft'
strimzi_feature_gates: '-UseKRaft'
strimzi_use_node_pools_in_tests: "false"
releaseVersion: '${{ parameters.releaseVersion }}'
kafkaVersion: '${{ parameters.kafkaVersion }}'
Expand All @@ -22,7 +22,7 @@ jobs:
cluster_operator_install_type: 'bundle'
timeout: 360
strimzi_rbac_scope: NAMESPACE
strimzi_feature_gates: '-UnidirectionalTopicOperator,-UseKRaft'
strimzi_feature_gates: '-UseKRaft'
strimzi_use_node_pools_in_tests: "false"
releaseVersion: '${{ parameters.releaseVersion }}'
kafkaVersion: '${{ parameters.kafkaVersion }}'
Expand All @@ -36,7 +36,7 @@ jobs:
cluster_operator_install_type: 'bundle'
timeout: 360
strimzi_rbac_scope: NAMESPACE
strimzi_feature_gates: '-UnidirectionalTopicOperator,-UseKRaft'
strimzi_feature_gates: '-UseKRaft'
strimzi_use_node_pools_in_tests: "false"
releaseVersion: '${{ parameters.releaseVersion }}'
kafkaVersion: '${{ parameters.kafkaVersion }}'
Expand All @@ -50,7 +50,7 @@ jobs:
cluster_operator_install_type: 'bundle'
timeout: 360
strimzi_rbac_scope: NAMESPACE
strimzi_feature_gates: '-UnidirectionalTopicOperator,-UseKRaft'
strimzi_feature_gates: '-UseKRaft'
strimzi_use_node_pools_in_tests: "false"
releaseVersion: '${{ parameters.releaseVersion }}'
kafkaVersion: '${{ parameters.kafkaVersion }}'
Expand All @@ -64,7 +64,7 @@ jobs:
cluster_operator_install_type: 'bundle'
timeout: 360
strimzi_rbac_scope: NAMESPACE
strimzi_feature_gates: '-UnidirectionalTopicOperator,-UseKRaft'
strimzi_feature_gates: '-UseKRaft'
strimzi_use_node_pools_in_tests: "false"
releaseVersion: '${{ parameters.releaseVersion }}'
kafkaVersion: '${{ parameters.kafkaVersion }}'
Expand All @@ -78,7 +78,7 @@ jobs:
cluster_operator_install_type: 'bundle'
timeout: 360
strimzi_rbac_scope: NAMESPACE
strimzi_feature_gates: '-UnidirectionalTopicOperator,-UseKRaft'
strimzi_feature_gates: '-UseKRaft'
strimzi_use_node_pools_in_tests: "false"
releaseVersion: '${{ parameters.releaseVersion }}'
kafkaVersion: '${{ parameters.kafkaVersion }}'
Expand All @@ -92,7 +92,7 @@ jobs:
cluster_operator_install_type: 'bundle'
timeout: 360
strimzi_rbac_scope: NAMESPACE
strimzi_feature_gates: '-UnidirectionalTopicOperator,-UseKRaft'
strimzi_feature_gates: '-UseKRaft'
strimzi_use_node_pools_in_tests: "false"
releaseVersion: '${{ parameters.releaseVersion }}'
kafkaVersion: '${{ parameters.kafkaVersion }}'
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
* The `KafkaNodePools` feature gate moves to GA stage and is permanently enabled without the possibility to disable it.
To use the Kafka Node Pool resources, you still need to use the `strimzi.io/node-pools: enabled` annotation on the `Kafka` custom resources.
* Added support for configuring the `externalIPs` field in node port type services.
* The `UnidirectionalTopicOperator` feature gate moves to GA stage and is permanently enabled without the possibility to disable it.
fvaleri marked this conversation as resolved.
Show resolved Hide resolved
If the topics whose names start with `strimzi-store-topic` and `strimzi-topic-operator` still exist, you can delete them.

### Changes, deprecations and removals

* The `tlsSidecar` configuration for the Entity Operator is now deprecated and will be ignored.
* The `zookeeperSessionTimeoutSeconds` and `topicMetadataMaxAttempts` configurations for the Entity Topic Operator have been removed and will be ignored.

## 0.40.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.strimzi.api.annotations.DeprecatedProperty;
import io.strimzi.api.kafka.model.common.Constants;
import io.strimzi.api.kafka.model.common.UnknownPropertyPreserving;
import io.strimzi.crdgenerator.annotations.Description;
Expand Down Expand Up @@ -58,6 +59,8 @@ public void setUserOperator(EntityUserOperatorSpec userOperator) {
this.userOperator = userOperator;
}

@Deprecated
@DeprecatedProperty(description = "TLS sidecar was removed in Strimzi 0.41.0. This property is ignored.")
@Description("TLS sidecar configuration")
@JsonInclude(JsonInclude.Include.NON_NULL)
public TlsSidecar getTlsSidecar() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.fabric8.kubernetes.api.model.ResourceRequirements;
import io.strimzi.api.annotations.DeprecatedProperty;
import io.strimzi.api.kafka.model.common.Constants;
import io.strimzi.api.kafka.model.common.HasConfigurableLogging;
import io.strimzi.api.kafka.model.common.HasLivenessProbe;
Expand All @@ -20,6 +21,7 @@
import io.strimzi.crdgenerator.annotations.DescriptionFile;
import io.strimzi.crdgenerator.annotations.KubeLink;
import io.strimzi.crdgenerator.annotations.Minimum;
import io.strimzi.crdgenerator.annotations.PresentInVersions;
import io.sundr.builder.annotations.Buildable;
import lombok.EqualsAndHashCode;
import lombok.ToString;
Expand Down Expand Up @@ -57,8 +59,8 @@ public class EntityTopicOperatorSpec implements HasConfigurableLogging, HasLiven
protected String watchedNamespace;
protected String image;
protected int reconciliationIntervalSeconds = DEFAULT_FULL_RECONCILIATION_INTERVAL_SECONDS;
protected int zookeeperSessionTimeoutSeconds = DEFAULT_ZOOKEEPER_SESSION_TIMEOUT_SECONDS;
protected int topicMetadataMaxAttempts = DEFAULT_TOPIC_METADATA_MAX_ATTEMPTS;
protected Integer zookeeperSessionTimeoutSeconds;
protected Integer topicMetadataMaxAttempts;
private Probe startupProbe;
private Probe livenessProbe;
private Probe readinessProbe;
Expand Down Expand Up @@ -95,26 +97,32 @@ public int getReconciliationIntervalSeconds() {
public void setReconciliationIntervalSeconds(int reconciliationIntervalSeconds) {
this.reconciliationIntervalSeconds = reconciliationIntervalSeconds;
}

@Description("Timeout for the ZooKeeper session")
@Minimum(0)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public int getZookeeperSessionTimeoutSeconds() {
@DeprecatedProperty(description = "This property is not used anymore in Strimzi 0.41.0 and it is ignored.")
@PresentInVersions("v1alpha1-v1beta2")
@Deprecated
public Integer getZookeeperSessionTimeoutSeconds() {
return zookeeperSessionTimeoutSeconds;
}

public void setZookeeperSessionTimeoutSeconds(int zookeeperSessionTimeoutSeconds) {
public void setZookeeperSessionTimeoutSeconds(Integer zookeeperSessionTimeoutSeconds) {
this.zookeeperSessionTimeoutSeconds = zookeeperSessionTimeoutSeconds;
}

@Description("The number of attempts at getting topic metadata")
@Minimum(0)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public int getTopicMetadataMaxAttempts() {
@DeprecatedProperty(description = "This property is not used anymore in Strimzi 0.41.0 and it is ignored.")
@PresentInVersions("v1alpha1-v1beta2")
@Deprecated
public Integer getTopicMetadataMaxAttempts() {
return topicMetadataMaxAttempts;
}

public void setTopicMetadataMaxAttempts(int topicMetadataMaxAttempts) {
public void setTopicMetadataMaxAttempts(Integer topicMetadataMaxAttempts) {
this.topicMetadataMaxAttempts = topicMetadataMaxAttempts;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.strimzi.api.annotations.DeprecatedType;
import io.strimzi.api.kafka.model.common.Constants;
import io.strimzi.api.kafka.model.common.HasLivenessProbe;
import io.strimzi.api.kafka.model.common.HasReadinessProbe;
Expand All @@ -33,12 +34,11 @@
@JsonPropertyOrder({"image", "resources", "livenessProbe", "readinessProbe", "logLevel"})
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Deprecated
@DeprecatedType(replacedWithType = void.class)
public class TlsSidecar extends Sidecar implements HasLivenessProbe, HasReadinessProbe {
private static final long serialVersionUID = 1L;

public static final int DEFAULT_HEALTHCHECK_DELAY = 15;
public static final int DEFAULT_HEALTHCHECK_TIMEOUT = 5;

private TlsSidecarLogLevel logLevel = TlsSidecarLogLevel.NOTICE;
private Probe livenessProbe;
private Probe readinessProbe;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

@Deprecated
public enum TlsSidecarLogLevel {

EMERG,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ default SecurityContext entityUserOperatorContainerSecurityContext(ContainerSecu
*
* @return Security context which will be set for the TLS sidecar container
*/
@Deprecated
@SuppressWarnings("unused")
default SecurityContext entityOperatorTlsSidecarContainerSecurityContext(ContainerSecurityProviderContext context) {
return securityContextOrNull(context);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ public class ClusterOperatorConfig {
public static final String STRIMZI_KAFKA_MIRROR_MAKER_2_IMAGES = "STRIMZI_KAFKA_MIRROR_MAKER_2_IMAGES";

/**
* Configures the Entity Operator TLS sidecar container images
* Configures the Entity Operator TLS sidecar container images.
* Used only to produce warning if defined at startup.
*/
public static final String STRIMZI_DEFAULT_TLS_SIDECAR_ENTITY_OPERATOR_IMAGE = "STRIMZI_DEFAULT_TLS_SIDECAR_ENTITY_OPERATOR_IMAGE";
private static final String STRIMZI_DEFAULT_TLS_SIDECAR_KAFKA_IMAGE = "STRIMZI_DEFAULT_TLS_SIDECAR_KAFKA_IMAGE"; // Used only to produce warning if defined at startup
private static final String STRIMZI_DEFAULT_TLS_SIDECAR_CRUISE_CONTROL_IMAGE = "STRIMZI_DEFAULT_TLS_SIDECAR_CRUISE_CONTROL_IMAGE"; // Used only to produce warning if defined at startup
private static final String STRIMZI_DEFAULT_TLS_SIDECAR_KAFKA_IMAGE = "STRIMZI_DEFAULT_TLS_SIDECAR_KAFKA_IMAGE";
private static final String STRIMZI_DEFAULT_TLS_SIDECAR_CRUISE_CONTROL_IMAGE = "STRIMZI_DEFAULT_TLS_SIDECAR_CRUISE_CONTROL_IMAGE";
private static final String STRIMZI_DEFAULT_TLS_SIDECAR_ENTITY_OPERATOR_IMAGE = "STRIMZI_DEFAULT_TLS_SIDECAR_ENTITY_OPERATOR_IMAGE";

/**
* Configures the Kafka Exporter container image
Expand Down Expand Up @@ -270,6 +271,10 @@ private static void warningsForRemovedEndVars(Map<String, String> map) {
LOGGER.warn("Cruise Control TLS sidecar container has been removed and the environment variable {} is not used anymore. " +
"You can remove it from the Strimzi Cluster Operator deployment.", STRIMZI_DEFAULT_TLS_SIDECAR_CRUISE_CONTROL_IMAGE);
}
if (map.containsKey(STRIMZI_DEFAULT_TLS_SIDECAR_ENTITY_OPERATOR_IMAGE)) {
LOGGER.warn("Entity Operator TLS sidecar container has been removed and the environment variable {} is not used anymore. " +
fvaleri marked this conversation as resolved.
Show resolved Hide resolved
"You can remove it from the Strimzi Cluster Operator deployment.", STRIMZI_DEFAULT_TLS_SIDECAR_ENTITY_OPERATOR_IMAGE);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ public class FeatureGates {
/* test */ static final FeatureGates NONE = new FeatureGates("");

private static final String USE_KRAFT = "UseKRaft";
private static final String UNIDIRECTIONAL_TOPIC_OPERATOR = "UnidirectionalTopicOperator";

// When adding new feature gates, do not forget to add them to allFeatureGates() and toString() methods
private final FeatureGate useKRaft = new FeatureGate(USE_KRAFT, true);
private final FeatureGate unidirectionalTopicOperator = new FeatureGate(UNIDIRECTIONAL_TOPIC_OPERATOR, true);

/**
* Constructs the feature gates configuration.
Expand All @@ -46,9 +44,6 @@ public FeatureGates(String featureGateConfig) {
case USE_KRAFT:
setValueOnlyOnce(useKRaft, value);
break;
case UNIDIRECTIONAL_TOPIC_OPERATOR:
setValueOnlyOnce(unidirectionalTopicOperator, value);
break;
default:
throw new InvalidConfigurationException("Unknown feature gate " + featureGate + " found in the configuration");
}
Expand Down Expand Up @@ -89,30 +84,21 @@ public boolean useKRaftEnabled() {
return useKRaft.isEnabled();
}

/**
* @return Returns true when the UnidirectionalTopicOperator feature gate is enabled
*/
public boolean unidirectionalTopicOperatorEnabled() {
return unidirectionalTopicOperator.isEnabled();
}

/**
* Returns a list of all Feature gates. Used for testing.
*
* @return List of all Feature Gates
*/
/*test*/ List<FeatureGate> allFeatureGates() {
return List.of(
useKRaft,
unidirectionalTopicOperator
useKRaft
);
}

@Override
public String toString() {
return "FeatureGates(" +
"UseKRaft=" + useKRaft.isEnabled() + "," +
"UnidirectionalTopicOperator=" + unidirectionalTopicOperator.isEnabled() +
"UseKRaft=" + useKRaft.isEnabled() +
")";
}

Expand Down
Loading
Loading