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

Update supported Kubernetes version to 1.23+ #9473

Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .azure/scripts/setup-helm.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -x

TEST_HELM3_VERSION=${TEST_HELM3_VERSION:-'v3.12.0'}
TEST_HELM3_VERSION=${TEST_HELM3_VERSION:-'v3.13.3'}

function install_helm3 {
export HELM_INSTALL_DIR=/usr/bin
Expand Down
2 changes: 1 addition & 1 deletion .azure/scripts/setup-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -xe

rm -rf ~/.kube

KUBE_VERSION=${KUBE_VERSION:-1.21.0}
KUBE_VERSION=${KUBE_VERSION:-1.23.0}
COPY_DOCKER_LOGIN=${COPY_DOCKER_LOGIN:-"false"}

DEFAULT_CLUSTER_MEMORY=$(free -m | grep "Mem" | awk '{print $2}')
Expand Down
2 changes: 1 addition & 1 deletion .azure/scripts/setup-kubernetes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -xe

rm -rf ~/.kube

KUBE_VERSION=${KUBE_VERSION:-1.21.0}
KUBE_VERSION=${KUBE_VERSION:-1.23.0}
MINIKUBE_REGISTRY_IMAGE=${REGISTRY_IMAGE:-"registry"}
COPY_DOCKER_LOGIN=${COPY_DOCKER_LOGIN:-"false"}

Expand Down
2 changes: 1 addition & 1 deletion .azure/templates/steps/default_variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ variables:
repo_slug: $(Build.Repository.Name)
commit_message: $(Build.SourceVersionMessage)
test_cluster: minikube
test_kubectl_version: v1.21.0
test_kubectl_version: v1.23.0
test_helm_version: v2.17.0
strimzi_default_log_level: DEBUG
operator_image_pull_policy: IfNotPresent
Expand Down
2 changes: 1 addition & 1 deletion .azure/templates/steps/prerequisites/install_helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ steps:
- bash: ".azure/scripts/setup-helm.sh"
displayName: "Install Helm"
env:
TEST_HELM3_VERSION: 'v3.12.0'
TEST_HELM3_VERSION: v3.13.3
4 changes: 2 additions & 2 deletions .azure/templates/steps/prerequisites/install_minikube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ steps:
displayName: "Setup Minikube cluster"
env:
TEST_CLUSTER: minikube
TEST_KUBECTL_VERSION: v1.21.0
TEST_MINIKUBE_VERSION: v1.24.0
TEST_KUBECTL_VERSION: v1.23.0
TEST_MINIKUBE_VERSION: v1.32.0
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
## 0.40.0


### Changes, deprecations and removals

* **From Strimzi 0.40.0 on, we support only Kubernetes 1.23 and newer.**
Kubernetes 1.21 and 1.22 are not supported anymore.

## 0.39.0

* Add support for Apache Kafka 3.5.2 and 3.6.1
Expand Down
13 changes: 3 additions & 10 deletions api/src/main/java/io/strimzi/platform/KubernetesVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,11 @@ public class KubernetesVersion implements Comparable<KubernetesVersion> {
private final int major;
private final int minor;

// unsupported versions
public static final KubernetesVersion V1_15 = new KubernetesVersion(1, 15);

// supported versions
public static final KubernetesVersion V1_21 = new KubernetesVersion(1, 21);
public static final KubernetesVersion V1_22 = new KubernetesVersion(1, 22);
// Notable Kubernetes versions => this includes the minimal supported version and for example also any Kubernetes
// versions from some features are supported.
public static final KubernetesVersion V1_23 = new KubernetesVersion(1, 23);
public static final KubernetesVersion V1_24 = new KubernetesVersion(1, 24);
public static final KubernetesVersion V1_25 = new KubernetesVersion(1, 25);
public static final KubernetesVersion V1_26 = new KubernetesVersion(1, 26);

public static final KubernetesVersion MINIMAL_SUPPORTED_VERSION = V1_21;
public static final KubernetesVersion MINIMAL_SUPPORTED_VERSION = V1_23;
public static final int MINIMAL_SUPPORTED_MAJOR = MINIMAL_SUPPORTED_VERSION.major;
public static final int MINIMAL_SUPPORTED_MINOR = MINIMAL_SUPPORTED_VERSION.minor;

Expand Down
32 changes: 19 additions & 13 deletions api/src/test/java/io/strimzi/platform/KubernetesVersionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,36 @@
import static org.hamcrest.Matchers.lessThan;

public class KubernetesVersionTest {
// Kubernetes versions used for tests => comparing Kubernetes versions
private static final KubernetesVersion V1_5 = new KubernetesVersion(1, 5); // very old version
private static final KubernetesVersion V1_14 = new KubernetesVersion(1, 14);
private static final KubernetesVersion V1_15 = new KubernetesVersion(1, 15);
private static final KubernetesVersion V1_16 = new KubernetesVersion(1, 16);

@Test
public void versionTest() {
KubernetesVersion kv1p5 = new KubernetesVersion(1, 5);
assertThat(kv1p5.compareTo(KubernetesVersion.V1_15), lessThan(0));
assertThat(kv1p5.compareTo(KubernetesVersion.V1_21), lessThan(0));
assertThat(kv1p5.compareTo(KubernetesVersion.V1_25), lessThan(0));
assertThat(kv1p5.compareTo(V1_14), lessThan(0));
assertThat(kv1p5.compareTo(V1_15), lessThan(0));
assertThat(kv1p5.compareTo(V1_16), lessThan(0));

assertThat(KubernetesVersion.V1_15.compareTo(KubernetesVersion.V1_15), is(0));
assertThat(KubernetesVersion.V1_15.compareTo(KubernetesVersion.V1_21), lessThan(0));
assertThat(KubernetesVersion.V1_15.compareTo(KubernetesVersion.V1_25), lessThan(0));
assertThat(V1_5.compareTo(V1_5), is(0));
assertThat(V1_5.compareTo(V1_14), lessThan(0));
assertThat(V1_5.compareTo(V1_15), lessThan(0));


assertThat(KubernetesVersion.V1_22.compareTo(KubernetesVersion.V1_15), greaterThan(0));
assertThat(KubernetesVersion.V1_22.compareTo(KubernetesVersion.V1_21), greaterThan(0));
assertThat(KubernetesVersion.V1_22.compareTo(KubernetesVersion.V1_22), is(0));
assertThat(V1_15.compareTo(V1_5), greaterThan(0));
assertThat(V1_15.compareTo(V1_14), greaterThan(0));
assertThat(V1_15.compareTo(V1_15), is(0));

KubernetesVersion kv2p22 = new KubernetesVersion(2, 22);
assertThat(kv2p22.compareTo(KubernetesVersion.V1_15), greaterThan(0));
assertThat(kv2p22.compareTo(KubernetesVersion.V1_21), greaterThan(0));
assertThat(kv2p22.compareTo(V1_5), greaterThan(0));
assertThat(kv2p22.compareTo(V1_15), greaterThan(0));
}

@Test
public void versionsEqualTest() {
KubernetesVersion kv1p25 = new KubernetesVersion(1, 25);
assertThat(kv1p25, is(KubernetesVersion.V1_25));
KubernetesVersion kv1p25 = new KubernetesVersion(1, 15);
assertThat(kv1p25, is(V1_15));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,17 @@ public class PlatformFeaturesAvailabilityTest {
public void testVersionDetectionOpenShift(Vertx vertx, VertxTestContext context) throws InterruptedException, ExecutionException {
String version = """
{
"major": "1",
"minor": "21",
"gitVersion": "v1.21.1",
"major": "%s",
"minor": "%S",
"gitVersion": "v%s.%s.1",
"gitCommit": "c4d752765b3bbac2237bf87cf0b1c2e307844666",
"gitTreeState": "clean",
"buildDate": "2020-12-18T12:00:47Z",
"goVersion": "go1.15.5",
"compiler": "gc",
"platform": "linux/amd64"
}""";
}"""
.formatted(KubernetesVersion.MINIMAL_SUPPORTED_MAJOR, KubernetesVersion.MINIMAL_SUPPORTED_MINOR, KubernetesVersion.MINIMAL_SUPPORTED_MAJOR, KubernetesVersion.MINIMAL_SUPPORTED_MINOR);

startMockApi(vertx, version, Collections.emptyList());

Expand All @@ -69,7 +70,7 @@ public void testVersionDetectionOpenShift(Vertx vertx, VertxTestContext context)
Checkpoint a = context.checkpoint();

PlatformFeaturesAvailability.create(vertx, client).onComplete(context.succeeding(pfa -> context.verify(() -> {
assertThat("Versions are not equal", pfa.getKubernetesVersion(), is(KubernetesVersion.V1_21));
assertThat("Versions are not equal", pfa.getKubernetesVersion(), is(KubernetesVersion.MINIMAL_SUPPORTED_VERSION));
a.flag();
})));
}
Expand All @@ -78,16 +79,17 @@ public void testVersionDetectionOpenShift(Vertx vertx, VertxTestContext context)
public void testVersionDetectionMinikube(Vertx vertx, VertxTestContext context) throws InterruptedException, ExecutionException {
String version = """
{
"major": "1",
"minor": "21",
"gitVersion": "v1.21.1",
"major": "%s",
"minor": "%s",
"gitVersion": "v%s.%s.1",
"gitCommit": "c4d752765b3bbac2237bf87cf0b1c2e307844666",
"gitTreeState": "clean",
"buildDate": "2020-12-18T12:09:25Z",
"goVersion": "go1.15.5",
"compiler": "gc",
"platform": "linux/amd64"
}""";
}"""
.formatted(KubernetesVersion.MINIMAL_SUPPORTED_MAJOR, KubernetesVersion.MINIMAL_SUPPORTED_MINOR, KubernetesVersion.MINIMAL_SUPPORTED_MAJOR, KubernetesVersion.MINIMAL_SUPPORTED_MINOR);

startMockApi(vertx, version, Collections.emptyList());

Expand All @@ -96,7 +98,7 @@ public void testVersionDetectionMinikube(Vertx vertx, VertxTestContext context)
Checkpoint async = context.checkpoint();

PlatformFeaturesAvailability.create(vertx, client).onComplete(context.succeeding(pfa -> context.verify(() -> {
assertThat("Versions are not equal", pfa.getKubernetesVersion(), is(KubernetesVersion.V1_21));
assertThat("Versions are not equal", pfa.getKubernetesVersion(), is(KubernetesVersion.MINIMAL_SUPPORTED_VERSION));
async.flag();
})));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public class KafkaAssemblyOperatorTest {
private final String differentMetricsCMName = "metrics-cm-2";
private final ConfigMap metricsCM = io.strimzi.operator.cluster.TestUtils.getJmxMetricsCm(metricsCmJson, metricsCMName, "metrics-config.yml");

private final KubernetesVersion kubernetesVersion = KubernetesVersion.V1_21;
private final KubernetesVersion kubernetesVersion = KubernetesVersion.MINIMAL_SUPPORTED_VERSION;

private static boolean openShift;
private static boolean metrics;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public class KafkaBridgeAssemblyOperatorTest {
private static final KafkaBridgeHttpConfig KAFKA_BRIDGE_HTTP_SPEC = new KafkaBridgeHttpConfig();
private final String image = "kafka-bridge:latest";

private final KubernetesVersion kubernetesVersion = KubernetesVersion.V1_21;
private final KubernetesVersion kubernetesVersion = KubernetesVersion.MINIMAL_SUPPORTED_VERSION;

@BeforeAll
public static void before() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public class KafkaConnectAssemblyOperatorPodSetTest {
private final static String COMPONENT_NAME = NAME + "-connect";
private final static String NAMESPACE = "my-namespace";
private static final KafkaVersion.Lookup VERSIONS = KafkaVersionTestUtils.getKafkaVersionLookup();
private static final KubernetesVersion KUBERNETES_VERSION = KubernetesVersion.V1_26;
private static final KubernetesVersion KUBERNETES_VERSION = KubernetesVersion.MINIMAL_SUPPORTED_VERSION;
private static final Reconciliation RECONCILIATION = new Reconciliation("test", "KafkaConnect", NAMESPACE, NAME);
private static final SharedEnvironmentProvider SHARED_ENV_PROVIDER = new MockSharedEnvironmentProvider();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void afterEach() {
public void testConnectorNotUpdatedWhenConfigUnchanged(VertxTestContext context) {
KafkaConnectApiImpl connectClient = new KafkaConnectApiImpl(vertx);

PlatformFeaturesAvailability pfa = new PlatformFeaturesAvailability(false, KubernetesVersion.V1_21);
PlatformFeaturesAvailability pfa = new PlatformFeaturesAvailability(false, KubernetesVersion.MINIMAL_SUPPORTED_VERSION);

String namespace = "ns";
String connectorName = "my-connector";
Expand Down Expand Up @@ -189,7 +189,7 @@ public void testConnectorNotUpdatedWhenConfigUnchanged(VertxTestContext context)
public void testConnectorResourceNotReadyWhenConnectorFailed(VertxTestContext context) {
KafkaConnectApiImpl connectClient = new KafkaConnectApiImpl(vertx);

PlatformFeaturesAvailability pfa = new PlatformFeaturesAvailability(false, KubernetesVersion.V1_21);
PlatformFeaturesAvailability pfa = new PlatformFeaturesAvailability(false, KubernetesVersion.MINIMAL_SUPPORTED_VERSION);

String namespace = "ns";
String connectorName = "my-connector-2";
Expand Down Expand Up @@ -238,7 +238,7 @@ public void testConnectorResourceNotReadyWhenConnectorFailed(VertxTestContext co
public void testConnectorResourceNotReadyWhenTaskFailed(VertxTestContext context) {
KafkaConnectApiImpl connectClient = new KafkaConnectApiImpl(vertx);

PlatformFeaturesAvailability pfa = new PlatformFeaturesAvailability(false, KubernetesVersion.V1_21);
PlatformFeaturesAvailability pfa = new PlatformFeaturesAvailability(false, KubernetesVersion.MINIMAL_SUPPORTED_VERSION);

String namespace = "ns";
String connectorName = "my-connector-3";
Expand Down Expand Up @@ -298,7 +298,7 @@ public void testConnectorResourceNotReadyWhenTaskFailed(VertxTestContext context
public void testConnectorIsAutoRestarted(VertxTestContext context) {
KafkaConnectApiImpl connectClient = new KafkaConnectApiImpl(vertx);

PlatformFeaturesAvailability pfa = new PlatformFeaturesAvailability(false, KubernetesVersion.V1_21);
PlatformFeaturesAvailability pfa = new PlatformFeaturesAvailability(false, KubernetesVersion.MINIMAL_SUPPORTED_VERSION);

String namespace = "ns";
String connectorName = "my-connector-4";
Expand Down Expand Up @@ -347,7 +347,7 @@ public void testConnectorIsAutoRestarted(VertxTestContext context) {
public void testTaskIsAutoRestarted(VertxTestContext context) {
KafkaConnectApiImpl connectClient = new KafkaConnectApiImpl(vertx);

PlatformFeaturesAvailability pfa = new PlatformFeaturesAvailability(false, KubernetesVersion.V1_21);
PlatformFeaturesAvailability pfa = new PlatformFeaturesAvailability(false, KubernetesVersion.MINIMAL_SUPPORTED_VERSION);

String namespace = "ns";
String connectorName = "my-connector-5";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class KafkaMirrorMaker2AssemblyOperatorPodSetTest {
private final static String COMPONENT_NAME = NAME + "-mirrormaker2";
private final static String NAMESPACE = "my-namespace";
private static final KafkaVersion.Lookup VERSIONS = KafkaVersionTestUtils.getKafkaVersionLookup();
private static final KubernetesVersion KUBERNETES_VERSION = KubernetesVersion.V1_26;
private static final KubernetesVersion KUBERNETES_VERSION = KubernetesVersion.MINIMAL_SUPPORTED_VERSION;
private static final Reconciliation RECONCILIATION = new Reconciliation("test", "KafkaMirrorMaker2", NAMESPACE, NAME);
private static final SharedEnvironmentProvider SHARED_ENV_PROVIDER = new MockSharedEnvironmentProvider();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class KafkaMirrorMakerAssemblyOperatorTest {
private final String include = ".*";
private final String image = "my-image:latest";

private final KubernetesVersion kubernetesVersion = KubernetesVersion.V1_21;
private final KubernetesVersion kubernetesVersion = KubernetesVersion.MINIMAL_SUPPORTED_VERSION;

@BeforeAll
public static void before() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class KafkaReconcilerStatusTest {
private final static String NAMESPACE = "testns";
private final static String CLUSTER_NAME = "testkafka";
private final static KafkaVersion.Lookup VERSIONS = KafkaVersionTestUtils.getKafkaVersionLookup();
private final static PlatformFeaturesAvailability PFA = new PlatformFeaturesAvailability(true, KubernetesVersion.V1_22);
private final static PlatformFeaturesAvailability PFA = new PlatformFeaturesAvailability(true, KubernetesVersion.MINIMAL_SUPPORTED_VERSION);
private final static KafkaVersionChange VERSION_CHANGE = new KafkaVersionChange(
VERSIONS.defaultVersion(),
VERSIONS.defaultVersion(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class KafkaReconcilerUpgradeDowngradeTest {
private final static String NAMESPACE = "testns";
private final static String CLUSTER_NAME = "testkafka";
private final static KafkaVersion.Lookup VERSIONS = KafkaVersionTestUtils.getKafkaVersionLookup();
private final static PlatformFeaturesAvailability PFA = new PlatformFeaturesAvailability(true, KubernetesVersion.V1_22);
private final static PlatformFeaturesAvailability PFA = new PlatformFeaturesAvailability(true, KubernetesVersion.MINIMAL_SUPPORTED_VERSION);
private final static ClusterOperatorConfig CO_CONFIG = ResourceUtils.dummyClusterOperatorConfig();
private final static ClusterCa CLUSTER_CA = new ClusterCa(
Reconciliation.DUMMY_RECONCILIATION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public class KubernetesRestartEventsMockTest {

private final static Kafka KAFKA = kafka();
private final static KafkaVersion.Lookup VERSIONS = KafkaVersionTestUtils.getKafkaVersionLookup();
private final static PlatformFeaturesAvailability PFA = new PlatformFeaturesAvailability(false, KubernetesVersion.V1_22);
private final static PlatformFeaturesAvailability PFA = new PlatformFeaturesAvailability(false, KubernetesVersion.MINIMAL_SUPPORTED_VERSION);
private final static KafkaVersionChange VERSION_CHANGE = new KafkaVersionChange(
VERSIONS.defaultVersion(),
VERSIONS.defaultVersion(),
Expand Down
2 changes: 1 addition & 1 deletion documentation/shared/attributes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
:UpgradeGuide: link:https://strimzi.io/docs/operators/0.24.0/deploying.html#assembly-upgrade-resources-str[Strimzi 0.24.0 upgrade documentation^]

// Kubernetes versions
:KubernetesVersion: 1.21 and later
:KubernetesVersion: 1.23 and later

// Kafka upgrade attributes used in kafka upgrades section
:DefaultKafkaVersion: 3.6.1
Expand Down
6 changes: 3 additions & 3 deletions packaging/helm-charts/helm3/strimzi-kafka-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Upgrading to Strimzi 0.32 and newer directly from Strimzi 0.22 and earlier is no
Please follow the [documentation](https://strimzi.io/docs/operators/latest/full/deploying.html#assembly-upgrade-str) for more details.

**!!! IMPORTANT !!!**
From Strimzi 0.36 on, we support only Kubernetes 1.21 and newer.
Kubernetes versions 1.19 and 1.20 are no longer supported.
From Strimzi 0.40 on, we support only Kubernetes 1.23 and newer.
Kubernetes versions 1.21 and 1.22 are no longer supported.

## Introduction

Expand Down Expand Up @@ -59,7 +59,7 @@ Strimzi is licensed under the [Apache License, Version 2.0](https://github.com/s

## Prerequisites

- Kubernetes 1.21+
- Kubernetes 1.23+

## Installing the Chart

Expand Down
2 changes: 1 addition & 1 deletion systemtest/scripts/results_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RESULTS_PATH=${1}
TEST_CASE=${2}
TEST_PROFILE=${3}
BUILD_ID=${4:-0}
KUBE_VERSION=${5:-1.21.0}
KUBE_VERSION=${5:-1.23.0}
TEST_ONLY=${6:-''}
TEST_COUNT_RUNNING_IN_PARALLEL=${7:-''}
EXCLUDED_GROUPS=${8:-''}
Expand Down
Loading