You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by gy...@apache.org on 2025/08/18 13:05:07 UTC

(flink-kubernetes-operator) branch main updated: [FLINK-38147] Add Flink 2.1 support

This is an automated email from the ASF dual-hosted git repository.

gyfora pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-kubernetes-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new b0274cb2 [FLINK-38147] Add Flink 2.1 support
b0274cb2 is described below

commit b0274cb2ea724c758182401de2d77908f2a2271e
Author: Gyula Fora <g_...@apple.com>
AuthorDate: Mon Aug 18 15:05:03 2025 +0200

    [FLINK-38147] Add Flink 2.1 support
---
 .github/workflows/ci.yml                           | 50 ++--------------------
 .github/workflows/e2e.yaml                         |  2 +-
 docs/content/docs/concepts/overview.md             |  2 +-
 docs/content/docs/custom-resource/reference.md     |  2 +
 e2e-tests/data/savepoint.yaml                      |  2 +-
 e2e-tests/test_snapshot.sh                         |  3 +-
 examples/basic-checkpoint-ha.yaml                  |  1 +
 .../kubernetes/operator/api/spec/FlinkVersion.java |  6 ++-
 .../crds/flinkdeployments.flink.apache.org-v1.yml  |  2 +
 9 files changed, 18 insertions(+), 52 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9285f96f..2d4b3d3d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -91,10 +91,10 @@ jobs:
         http-client: [ "okhttp" ]
         java-version: [ "17"]
         flink-version:
+          - "v2_1"
           - "v2_0"
           - "v1_20"
           - "v1_19"
-          - "v1_18"
     uses: ./.github/workflows/e2e.yaml
     with:
       java-version: ${{ matrix.java-version }}
@@ -108,11 +108,10 @@ jobs:
     strategy:
       matrix:
         flink-version:
+          - "v2_1"
           - "v2_0"
           - "v1_20"
           - "v1_19"
-          - "v1_18"
-          - "v1_17"
         mode:
          - "native"
          - "standalone"
@@ -129,16 +128,6 @@ jobs:
             test: test_dynamic_config.sh
           - mode: standalone
             test: test_dynamic_flink_conf.sh
-          - flink-version: v1_16
-            test: test_autoscaler.sh
-          - flink-version: v1_16
-            test: test_dynamic_config.sh
-          - flink-version: v1_17
-            test: test_dynamic_config.sh
-          - flink-version: v1_18
-            test: test_dynamic_config.sh
-          - flink-version: v1_16
-            test: test_dynamic_flink_conf.sh
 
     uses: ./.github/workflows/e2e.yaml
     with:
@@ -153,11 +142,10 @@ jobs:
     strategy:
       matrix:
         flink-version:
+          - "v2_1"
           - "v2_0"
           - "v1_20"
-          - "v1_18"
           - "v1_19"
-          - "v1_17"
         mode:
           - "native"
           - "standalone"
@@ -173,40 +161,8 @@ jobs:
           - test_snapshot.sh
           - test_batch_job.sh
         exclude:
-          - flink-version: v1_16
-            test: test_autoscaler.sh
           - mode: standalone
             test: test_autoscaler.sh
-          - flink-version: v1_16
-            test: test_dynamic_config.sh
-          - flink-version: v1_16
-            test: test_dynamic_flink_conf.sh
-          - flink-version: v1_16
-            test: test_flink_operator_ha.sh
-          - flink-version: v1_16
-            test: test_snapshot.sh
-          - flink-version: v1_16
-            test: test_batch_job.sh
-          - flink-version: v1_17
-            test: test_dynamic_config.sh
-          - flink-version: v1_17
-            test: test_dynamic_flink_conf.sh
-          - flink-version: v1_17
-            test: test_flink_operator_ha.sh
-          - flink-version: v1_17
-            test: test_snapshot.sh
-          - flink-version: v1_17
-            test: test_batch_job.sh
-          - flink-version: v1_18
-            test: test_dynamic_config.sh
-          - flink-version: v1_18
-            test: test_dynamic_flink_conf.sh
-          - flink-version: v1_18
-            test: test_flink_operator_ha.sh
-          - flink-version: v1_18
-            test: test_snapshot.sh
-          - flink-version: v1_18
-            test: test_batch_job.sh
           - flink-version: v1_19
             test: test_snapshot.sh
     uses: ./.github/workflows/e2e.yaml
diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml
index c266a334..5434da7a 100644
--- a/.github/workflows/e2e.yaml
+++ b/.github/workflows/e2e.yaml
@@ -90,7 +90,7 @@ jobs:
           
           EXAMPLES_JAR="https://repo1.maven.org/maven2/org/apache/flink/flink-examples-streaming_2.12/1.14.4/flink-examples-streaming_2.12-1.14.4.jar"
           if [[ ${{ inputs.flink-version }} == v2* ]]; then
-            EXAMPLES_JAR="https://repo1.maven.org/maven2/org/apache/flink/flink-examples-streaming/2.0-preview1/flink-examples-streaming-2.0-preview1.jar"
+            EXAMPLES_JAR="https://repo1.maven.org/maven2/org/apache/flink/flink-examples-streaming/2.0.0/flink-examples-streaming-2.0.0.jar"
           elif [[ "${{ inputs.test }}" == "test_batch_job.sh" ]]; then
             EXAMPLES_JAR="https://repo1.maven.org/maven2/org/apache/flink/flink-examples-streaming/1.20.1/flink-examples-streaming-1.20.1.jar"
           fi
diff --git a/docs/content/docs/concepts/overview.md b/docs/content/docs/concepts/overview.md
index e19fec4c..51965220 100644
--- a/docs/content/docs/concepts/overview.md
+++ b/docs/content/docs/concepts/overview.md
@@ -36,7 +36,7 @@ Flink Kubernetes Operator aims to capture the responsibilities of a human operat
   - Stateful and stateless application upgrades
   - Triggering and managing savepoints
   - Handling errors, rolling-back broken upgrades
-- Multiple Flink version support: v1.16, v1.17, v1.18, v1.19, v1.20
+- Multiple Flink version support: v1.17, v1.18, v1.19, v1.20, v2.0, v2.1
 - [Deployment Modes]({{< ref "docs/custom-resource/overview#application-deployments" >}}):
   - Application cluster
   - Session cluster
diff --git a/docs/content/docs/custom-resource/reference.md b/docs/content/docs/custom-resource/reference.md
index 909343c1..d08b58b4 100644
--- a/docs/content/docs/custom-resource/reference.md
+++ b/docs/content/docs/custom-resource/reference.md
@@ -118,6 +118,8 @@ This serves as a full reference for FlinkDeployment and FlinkSessionJob custom r
 | v1_19 |  |
 | v1_20 |  |
 | v2_0 |  |
+| v2_1 |  |
+| v2_2 |  |
 | majorVersion | int | The major integer from the Flink semver. For example for Flink 1.18.1 this would be 1. |
 | minorVersion | int | The minor integer from the Flink semver. For example for Flink 1.18.1 this would be 18. |
 
diff --git a/e2e-tests/data/savepoint.yaml b/e2e-tests/data/savepoint.yaml
index e32e9291..1ec51e32 100644
--- a/e2e-tests/data/savepoint.yaml
+++ b/e2e-tests/data/savepoint.yaml
@@ -28,5 +28,5 @@ spec:
   savepoint:
     alreadyExists: false
     disposeOnDelete: true
-    formatType: CANONICAL
+    formatType: NATIVE
 
diff --git a/e2e-tests/test_snapshot.sh b/e2e-tests/test_snapshot.sh
index 32006ddb..8061318a 100755
--- a/e2e-tests/test_snapshot.sh
+++ b/e2e-tests/test_snapshot.sh
@@ -53,7 +53,8 @@ wait_for_status $APPLICATION_IDENTIFIER '.status.jobStatus.state' RUNNING ${TIME
 
 
 # Test upgrade by setting legacy field
-kubectl patch flinkdep ${CLUSTER_ID} --type merge --patch '{"spec":{"job":{"state": "suspended"}}}'
+# Use native savepoints to avoid Flink 2.0/2.1 issues
+kubectl patch flinkdep ${CLUSTER_ID} --type merge --patch '{"spec":{"job":{"state": "suspended"}, "flinkConfiguration":{"kubernetes.operator.savepoint.format.type" : "NATIVE"} }}'
 wait_for_status $APPLICATION_IDENTIFIER '.status.lifecycleState' "SUSPENDED" ${TIMEOUT} || exit 1
 
 location=$(kubectl get $APPLICATION_IDENTIFIER -o yaml | yq '.status.jobStatus.upgradeSavepointPath')
diff --git a/examples/basic-checkpoint-ha.yaml b/examples/basic-checkpoint-ha.yaml
index 4cdce8e5..f8f51d68 100644
--- a/examples/basic-checkpoint-ha.yaml
+++ b/examples/basic-checkpoint-ha.yaml
@@ -29,6 +29,7 @@ spec:
     state.checkpoints.dir: file:///flink-data/checkpoints
     high-availability.type: kubernetes
     high-availability.storageDir: file:///flink-data/ha
+    kubernetes.operator.savepoint.format.type: NATIVE
   serviceAccount: flink
   jobManager:
     resource:
diff --git a/flink-kubernetes-operator-api/src/main/java/org/apache/flink/kubernetes/operator/api/spec/FlinkVersion.java b/flink-kubernetes-operator-api/src/main/java/org/apache/flink/kubernetes/operator/api/spec/FlinkVersion.java
index b636ae53..064bc213 100644
--- a/flink-kubernetes-operator-api/src/main/java/org/apache/flink/kubernetes/operator/api/spec/FlinkVersion.java
+++ b/flink-kubernetes-operator-api/src/main/java/org/apache/flink/kubernetes/operator/api/spec/FlinkVersion.java
@@ -35,11 +35,15 @@ public enum FlinkVersion {
     /** Deprecated since 1.11 operator release. */
     @Deprecated
     v1_16(1, 16),
+    @Deprecated
     v1_17(1, 17),
+    @Deprecated
     v1_18(1, 18),
     v1_19(1, 19),
     v1_20(1, 20),
-    v2_0(2, 0);
+    v2_0(2, 0),
+    v2_1(2, 1),
+    v2_2(2, 2);
 
     /** The major integer from the Flink semver. For example for Flink 1.18.1 this would be 1. */
     private final int majorVersion;
diff --git a/helm/flink-kubernetes-operator/crds/flinkdeployments.flink.apache.org-v1.yml b/helm/flink-kubernetes-operator/crds/flinkdeployments.flink.apache.org-v1.yml
index 292ecf3d..a0b68deb 100644
--- a/helm/flink-kubernetes-operator/crds/flinkdeployments.flink.apache.org-v1.yml
+++ b/helm/flink-kubernetes-operator/crds/flinkdeployments.flink.apache.org-v1.yml
@@ -46,6 +46,8 @@ spec:
                 - v1_19
                 - v1_20
                 - v2_0
+                - v2_1
+                - v2_2
                 type: string
               image:
                 type: string