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 2022/11/04 11:07:24 UTC

[flink-kubernetes-operator] branch main updated (78f4e9df -> 0b82f860)

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

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


    from 78f4e9df [FLINK-29655] Move FlinkResourceListener to api module
     new 45a280aa [FLINK-29851] Upgrade fabric8 and java operator sdk
     new 0b82f860 [FLINK-29851] Optimize poms and drop flink-kubernetes-shaded module

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Dockerfile                                         |   4 +-
 flink-kubernetes-operator-api/pom.xml              |  19 +---
 .../api/validation/CrdCompatibilityChecker.java    |   7 +-
 flink-kubernetes-operator/pom.xml                  |  67 ++++++------
 .../operator/config/FlinkConfigBuilder.java        |   4 +-
 .../config/KubernetesOperatorConfigOptions.java    |   2 -
 .../operator/health/OperatorHealthHandler.java     |   3 -
 .../operator/metrics/OperatorJosdkMetrics.java     |   2 -
 .../operator/service/StandaloneFlinkService.java   |  12 +--
 .../kubernetes/operator/utils/FlinkUtils.java      |   6 +-
 .../operator/utils/KubernetesClientUtils.java      |  34 +++---
 .../src/main/resources/META-INF/NOTICE             |  66 ++++++------
 .../flink/kubernetes/operator/TestUtils.java       |  13 +++
 .../metrics/KubernetesClientMetricsTest.java       |   6 +-
 .../kubernetes/operator/utils/FlinkUtilsTest.java  |   5 +-
 flink-kubernetes-shaded/pom.xml                    | 120 ---------------------
 flink-kubernetes-standalone/pom.xml                | 104 ++++++++++--------
 .../Fabric8FlinkStandaloneKubeClient.java          |  11 +-
 .../crds/flinkdeployments.flink.apache.org-v1.yml  |  48 ++++++---
 pom.xml                                            |  11 +-
 20 files changed, 230 insertions(+), 314 deletions(-)
 delete mode 100644 flink-kubernetes-shaded/pom.xml


[flink-kubernetes-operator] 01/02: [FLINK-29851] Upgrade fabric8 and java operator sdk

Posted by gy...@apache.org.
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

commit 45a280aa2d6824ded3a03b503dc33208f159f5d9
Author: Gyula Fora <g_...@apple.com>
AuthorDate: Wed Nov 2 20:27:11 2022 +0100

    [FLINK-29851] Upgrade fabric8 and java operator sdk
---
 flink-kubernetes-operator-api/pom.xml              | 21 +------
 .../api/validation/CrdCompatibilityChecker.java    |  7 ++-
 flink-kubernetes-operator/pom.xml                  | 64 +++++++++------------
 .../operator/config/FlinkConfigBuilder.java        |  4 +-
 .../config/KubernetesOperatorConfigOptions.java    |  2 -
 .../operator/health/OperatorHealthHandler.java     |  3 -
 .../operator/metrics/OperatorJosdkMetrics.java     |  2 -
 .../kubernetes/operator/utils/FlinkUtils.java      |  6 +-
 .../operator/utils/KubernetesClientUtils.java      | 34 ++++++-----
 .../src/main/resources/META-INF/NOTICE             | 66 +++++++++++-----------
 .../flink/kubernetes/operator/TestUtils.java       | 13 +++++
 .../metrics/KubernetesClientMetricsTest.java       |  6 +-
 .../kubernetes/operator/utils/FlinkUtilsTest.java  |  5 +-
 flink-kubernetes-standalone/pom.xml                |  3 +-
 .../crds/flinkdeployments.flink.apache.org-v1.yml  | 48 ++++++++++++----
 pom.xml                                            |  7 ++-
 16 files changed, 158 insertions(+), 133 deletions(-)

diff --git a/flink-kubernetes-operator-api/pom.xml b/flink-kubernetes-operator-api/pom.xml
index 100411c1..c6c28481 100644
--- a/flink-kubernetes-operator-api/pom.xml
+++ b/flink-kubernetes-operator-api/pom.xml
@@ -68,20 +68,12 @@ under the License.
             <groupId>io.fabric8</groupId>
             <artifactId>kubernetes-client</artifactId>
             <version>${fabric8.version}</version>
-            <!-- FLINK-29384, can be removed when fabric8 pulls snakeyaml 1.32+ -->
             <exclusions>
                 <exclusion>
-                    <groupId>org.yaml</groupId>
-                    <artifactId>snakeyaml</artifactId>
+                    <groupId>com.squareup.okhttp3</groupId>
+                    <artifactId>*</artifactId>
                 </exclusion>
-            </exclusions>
-        </dependency>
-
-        <!-- FLINK-29384, can be removed when fabric8 pulls snakeyaml 1.32+ -->
-        <dependency>
-            <groupId>org.yaml</groupId>
-            <artifactId>snakeyaml</artifactId>
-            <version>${snakeyaml.version}</version>
+              </exclusions>
         </dependency>
 
         <!-- Utils -->
@@ -97,13 +89,6 @@ under the License.
             <version>${commons-io.version}</version>
         </dependency>
 
-        <dependency>
-            <groupId>org.jetbrains</groupId>
-            <artifactId>annotations</artifactId>
-            <version>${jetbrains.version}</version>
-            <scope>provided</scope>
-        </dependency>
-
         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
diff --git a/flink-kubernetes-operator-api/src/main/java/org/apache/flink/kubernetes/operator/api/validation/CrdCompatibilityChecker.java b/flink-kubernetes-operator-api/src/main/java/org/apache/flink/kubernetes/operator/api/validation/CrdCompatibilityChecker.java
index 24e536ed..daabc456 100644
--- a/flink-kubernetes-operator-api/src/main/java/org/apache/flink/kubernetes/operator/api/validation/CrdCompatibilityChecker.java
+++ b/flink-kubernetes-operator-api/src/main/java/org/apache/flink/kubernetes/operator/api/validation/CrdCompatibilityChecker.java
@@ -82,7 +82,12 @@ public class CrdCompatibilityChecker {
                 var field = fieldNamesIt.next();
                 var fieldPath = path + "." + field;
                 if (!newProps.has(field)) {
-                    err(fieldPath + " has been removed");
+                    // This field was removed from Kubernetes ObjectMeta v1 in 1.25 as it was unused
+                    // for a long time. If set for any reason (very unlikely as it does nothing),
+                    // the property will be dropped / ignored by the api server.
+                    if (!fieldPath.endsWith(".metadata.clusterName")) {
+                        err(fieldPath + " has been removed");
+                    }
                 } else {
                     checkObjectCompatibility(fieldPath, oldProps.get(field), newProps.get(field));
                 }
diff --git a/flink-kubernetes-operator/pom.xml b/flink-kubernetes-operator/pom.xml
index 5fcfebb5..763d46e2 100644
--- a/flink-kubernetes-operator/pom.xml
+++ b/flink-kubernetes-operator/pom.xml
@@ -43,30 +43,32 @@ under the License.
             <version>${operator.sdk.version}</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-kubernetes-operator-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
         <dependency>
             <groupId>io.fabric8</groupId>
-            <artifactId>kubernetes-client</artifactId>
+            <artifactId>kubernetes-httpclient-okhttp</artifactId>
             <version>${fabric8.version}</version>
-            <!-- FLINK-29384, can be removed when fabric8 pulls snakeyaml 1.32+ -->
             <exclusions>
                 <exclusion>
-                    <groupId>org.yaml</groupId>
-                    <artifactId>snakeyaml</artifactId>
+                    <groupId>com.squareup.okhttp3</groupId>
+                    <artifactId>*</artifactId>
                 </exclusion>
             </exclusions>
         </dependency>
-
         <dependency>
-            <groupId>org.apache.flink</groupId>
-            <artifactId>flink-kubernetes-operator-api</artifactId>
-            <version>${project.version}</version>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+            <version>${okhttp.version}</version>
         </dependency>
-
-        <!-- FLINK-29384, can be removed when fabric8 pulls snakeyaml 1.32+ -->
         <dependency>
-            <groupId>org.yaml</groupId>
-            <artifactId>snakeyaml</artifactId>
-            <version>${snakeyaml.version}</version>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>logging-interceptor</artifactId>
+            <version>${okhttp.version}</version>
         </dependency>
 
         <!-- Flink -->
@@ -93,6 +95,12 @@ under the License.
             <artifactId>flink-kubernetes-shaded</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>io.fabric8</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
         <dependency>
@@ -149,6 +157,13 @@ under the License.
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>mockwebserver</artifactId>
+            <version>${okhttp.version}</version>
+            <scope>test</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.flink</groupId>
             <artifactId>flink-test-utils</artifactId>
@@ -170,29 +185,6 @@ under the License.
             <version>${junit.jupiter.version}</version>
             <scope>test</scope>
         </dependency>
-
-        <!-- okhttp -->
-        <!--
-            Regarding the okhttp explicit version
-            see https://github.com/fabric8io/kubernetes-client/issues/4290
-            and https://issues.apache.org/jira/browse/FLINK-28637
-            -->
-        <dependency>
-            <groupId>com.squareup.okhttp3</groupId>
-            <artifactId>okhttp</artifactId>
-            <version>${okhttp.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.squareup.okhttp3</groupId>
-            <artifactId>logging-interceptor</artifactId>
-            <version>${okhttp.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.squareup.okhttp3</groupId>
-            <artifactId>mockwebserver</artifactId>
-            <version>${okhttp.version}</version>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 
     <build>
diff --git a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/FlinkConfigBuilder.java b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/FlinkConfigBuilder.java
index 79be51c8..1542b30b 100644
--- a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/FlinkConfigBuilder.java
+++ b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/FlinkConfigBuilder.java
@@ -47,7 +47,7 @@ import org.apache.flink.util.FileUtils;
 import org.apache.flink.util.StringUtils;
 
 import io.fabric8.kubernetes.api.model.Pod;
-import io.fabric8.kubernetes.client.internal.SerializationUtils;
+import io.fabric8.kubernetes.client.utils.Serialization;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -426,7 +426,7 @@ public class FlinkConfigBuilder {
 
     private static String createTempFile(Pod podTemplate) throws IOException {
         final File tmp = File.createTempFile(GENERATED_FILE_PREFIX + "podTemplate_", ".yaml");
-        Files.write(tmp.toPath(), SerializationUtils.dumpAsYaml(podTemplate).getBytes());
+        Files.write(tmp.toPath(), Serialization.asYaml(podTemplate).getBytes());
         tmp.deleteOnExit();
         return tmp.getAbsolutePath();
     }
diff --git a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/KubernetesOperatorConfigOptions.java b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/KubernetesOperatorConfigOptions.java
index d380cea6..8e229b80 100644
--- a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/KubernetesOperatorConfigOptions.java
+++ b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/KubernetesOperatorConfigOptions.java
@@ -25,7 +25,6 @@ import org.apache.flink.core.execution.SavepointFormatType;
 
 import io.javaoperatorsdk.operator.api.config.ConfigurationService;
 import io.javaoperatorsdk.operator.api.reconciler.Constants;
-import org.jetbrains.annotations.NotNull;
 
 import java.time.Duration;
 import java.util.Map;
@@ -39,7 +38,6 @@ public class KubernetesOperatorConfigOptions {
     public static final String SECTION_ADVANCED = "system_advanced";
     public static final String SECTION_DYNAMIC = "dynamic";
 
-    @NotNull
     public static ConfigOptions.OptionBuilder operatorConfig(String key) {
         return ConfigOptions.key(K8S_OP_CONF_PREFIX + key);
     }
diff --git a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/health/OperatorHealthHandler.java b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/health/OperatorHealthHandler.java
index d4098b41..75ec0772 100644
--- a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/health/OperatorHealthHandler.java
+++ b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/health/OperatorHealthHandler.java
@@ -30,8 +30,6 @@ import org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpObject;
 import org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpResponseStatus;
 import org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpVersion;
 
-import org.jetbrains.annotations.NotNull;
-
 import java.nio.charset.StandardCharsets;
 
 /**
@@ -62,7 +60,6 @@ public class OperatorHealthHandler extends SimpleChannelInboundHandler<HttpObjec
         }
     }
 
-    @NotNull
     private DefaultFullHttpResponse createResponse(String content, HttpResponseStatus status) {
         ByteBuf buff = Unpooled.copiedBuffer(content, StandardCharsets.UTF_8);
         DefaultFullHttpResponse response =
diff --git a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/metrics/OperatorJosdkMetrics.java b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/metrics/OperatorJosdkMetrics.java
index 9be75bad..931f2d27 100644
--- a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/metrics/OperatorJosdkMetrics.java
+++ b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/metrics/OperatorJosdkMetrics.java
@@ -35,7 +35,6 @@ import io.javaoperatorsdk.operator.processing.GroupVersionKind;
 import io.javaoperatorsdk.operator.processing.event.Event;
 import io.javaoperatorsdk.operator.processing.event.ResourceID;
 import io.javaoperatorsdk.operator.processing.event.source.controller.ResourceEvent;
-import org.jetbrains.annotations.NotNull;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -196,7 +195,6 @@ public class OperatorJosdkMetrics implements Metrics {
                                 rid.getNamespace().orElse("default")));
     }
 
-    @NotNull
     private Optional<Class<? extends AbstractFlinkResource<?, ?>>> getResourceClass(
             Map<String, Object> metadata) {
         var resourceGvk = (GroupVersionKind) metadata.get(Constants.RESOURCE_GVK_KEY);
diff --git a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/FlinkUtils.java b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/FlinkUtils.java
index b99314cc..c17a2495 100644
--- a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/FlinkUtils.java
+++ b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/FlinkUtils.java
@@ -148,7 +148,11 @@ public class FlinkUtils {
                         .getItems();
 
         return configMaps.stream()
-                .anyMatch(map -> !map.isMarkedForDeletion() && map.getData() != null);
+                .anyMatch(
+                        map ->
+                                !map.isMarkedForDeletion()
+                                        && map.getData() != null
+                                        && !map.getData().isEmpty());
     }
 
     private static boolean isJobGraphKey(Map.Entry<String, String> entry) {
diff --git a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/KubernetesClientUtils.java b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/KubernetesClientUtils.java
index 46363b50..119a3db8 100644
--- a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/KubernetesClientUtils.java
+++ b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/KubernetesClientUtils.java
@@ -24,18 +24,17 @@ import org.apache.flink.kubernetes.operator.metrics.KubernetesClientMetrics;
 import org.apache.flink.metrics.MetricGroup;
 
 import io.fabric8.kubernetes.client.Config;
-import io.fabric8.kubernetes.client.DefaultKubernetesClient;
 import io.fabric8.kubernetes.client.KubernetesClient;
+import io.fabric8.kubernetes.client.KubernetesClientBuilder;
 import io.fabric8.kubernetes.client.okhttp.OkHttpClientFactory;
-import io.fabric8.kubernetes.client.okhttp.OkHttpClientImpl;
+import okhttp3.OkHttpClient;
 
 /** Kubernetes client utils. */
 public class KubernetesClientUtils {
 
     public static KubernetesClient getKubernetesClient(
             FlinkOperatorConfiguration operatorConfig, MetricGroup metricGroup) {
-        return getKubernetesClient(
-                operatorConfig, metricGroup, new DefaultKubernetesClient().getConfiguration());
+        return getKubernetesClient(operatorConfig, metricGroup, null);
     }
 
     @VisibleForTesting
@@ -43,16 +42,25 @@ public class KubernetesClientUtils {
             FlinkOperatorConfiguration operatorConfig,
             MetricGroup metricGroup,
             Config kubernetesClientConfig) {
-        var httpClientBuilder =
-                new OkHttpClientFactory()
-                        .createHttpClient(kubernetesClientConfig)
-                        .getOkHttpClient()
-                        .newBuilder();
+
+        var clientBuilder = new KubernetesClientBuilder().withConfig(kubernetesClientConfig);
+
         if (operatorConfig.isKubernetesClientMetricsEnabled()) {
-            httpClientBuilder.addInterceptor(
-                    new KubernetesClientMetrics(metricGroup, operatorConfig));
+            clientBuilder =
+                    clientBuilder.withHttpClientFactory(
+                            // This logic should be replaced with a more generic solution once the
+                            // fabric8 Interceptor class is improved to the point where this can be
+                            // implemented.
+                            new OkHttpClientFactory() {
+                                @Override
+                                protected void additionalConfig(OkHttpClient.Builder builder) {
+                                    builder.addInterceptor(
+                                            new KubernetesClientMetrics(
+                                                    metricGroup, operatorConfig));
+                                }
+                            });
         }
-        return new DefaultKubernetesClient(
-                new OkHttpClientImpl(httpClientBuilder.build()), kubernetesClientConfig);
+
+        return clientBuilder.build();
     }
 }
diff --git a/flink-kubernetes-operator/src/main/resources/META-INF/NOTICE b/flink-kubernetes-operator/src/main/resources/META-INF/NOTICE
index f468958f..ee3cf64f 100644
--- a/flink-kubernetes-operator/src/main/resources/META-INF/NOTICE
+++ b/flink-kubernetes-operator/src/main/resources/META-INF/NOTICE
@@ -6,12 +6,11 @@ The Apache Software Foundation (http://www.apache.org/).
 
 This project bundles the following dependencies under the Apache Software License 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt)
 
-- com.fasterxml.jackson.core:jackson-annotations:2.13.2
-- com.fasterxml.jackson.core:jackson-core:2.13.2
-- com.fasterxml.jackson.core:jackson-databind:2.13.2.2
-- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.2
-- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.2
-- com.github.mifmif:generex:1.0.2
+- com.fasterxml.jackson.core:jackson-annotations:2.13.4
+- com.fasterxml.jackson.core:jackson-core:2.13.4
+- com.fasterxml.jackson.core:jackson-databind:2.13.4
+- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.4
+- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.4
 - com.google.code.findbugs:jsr305:1.3.9
 - com.squareup.okhttp3:logging-interceptor:4.10.0
 - com.squareup.okhttp3:okhttp:4.10.0
@@ -21,30 +20,34 @@ This project bundles the following dependencies under the Apache Software Licens
 - commons-cli:commons-cli:1.5.0
 - commons-collections:commons-collections:3.2.2
 - commons-io:commons-io:2.11.0
-- io.fabric8:kubernetes-client:5.12.3
-- io.fabric8:kubernetes-model-admissionregistration:5.12.3
-- io.fabric8:kubernetes-model-apiextensions:5.12.3
-- io.fabric8:kubernetes-model-apps:5.12.3
-- io.fabric8:kubernetes-model-autoscaling:5.12.3
-- io.fabric8:kubernetes-model-batch:5.12.3
-- io.fabric8:kubernetes-model-certificates:5.12.3
-- io.fabric8:kubernetes-model-common:5.12.3
-- io.fabric8:kubernetes-model-coordination:5.12.3
-- io.fabric8:kubernetes-model-core:5.12.3
-- io.fabric8:kubernetes-model-discovery:5.12.3
-- io.fabric8:kubernetes-model-events:5.12.3
-- io.fabric8:kubernetes-model-extensions:5.12.3
-- io.fabric8:kubernetes-model-flowcontrol:5.12.3
-- io.fabric8:kubernetes-model-metrics:5.12.3
-- io.fabric8:kubernetes-model-networking:5.12.3
-- io.fabric8:kubernetes-model-node:5.12.3
-- io.fabric8:kubernetes-model-policy:5.12.3
-- io.fabric8:kubernetes-model-rbac:5.12.3
-- io.fabric8:kubernetes-model-scheduling:5.12.3
-- io.fabric8:kubernetes-model-storageclass:5.12.3
-- io.fabric8:zjsonpatch:0.3.0
-- io.javaoperatorsdk:operator-framework-core:3.2.2
-- io.javaoperatorsdk:operator-framework:3.2.2
+- io.fabric8:kubernetes-client-api:jar:6.2.0
+- io.fabric8:kubernetes-client:jar:6.2.0
+- io.fabric8:kubernetes-httpclient-okhttp:jar:6.2.0
+- io.fabric8:kubernetes-model-admissionregistration:jar:6.2.0
+- io.fabric8:kubernetes-model-apiextensions:jar:6.2.0
+- io.fabric8:kubernetes-model-apps:jar:6.2.0
+- io.fabric8:kubernetes-model-autoscaling:jar:6.2.0
+- io.fabric8:kubernetes-model-batch:jar:6.2.0
+- io.fabric8:kubernetes-model-certificates:jar:6.2.0
+- io.fabric8:kubernetes-model-common:jar:6.2.0
+- io.fabric8:kubernetes-model-coordination:jar:6.2.0
+- io.fabric8:kubernetes-model-core:jar:6.2.0
+- io.fabric8:kubernetes-model-discovery:jar:6.2.0
+- io.fabric8:kubernetes-model-events:jar:6.2.0
+- io.fabric8:kubernetes-model-extensions:jar:6.2.0
+- io.fabric8:kubernetes-model-flowcontrol:jar:6.2.0
+- io.fabric8:kubernetes-model-gatewayapi:jar:6.2.0
+- io.fabric8:kubernetes-model-metrics:jar:6.2.0
+- io.fabric8:kubernetes-model-networking:jar:6.2.0
+- io.fabric8:kubernetes-model-node:jar:6.2.0
+- io.fabric8:kubernetes-model-policy:jar:6.2.0
+- io.fabric8:kubernetes-model-rbac:jar:6.2.0
+- io.fabric8:kubernetes-model-scheduling:jar:6.2.0
+- io.fabric8:kubernetes-model-storageclass:jar:6.2.0
+- io.fabric8:zjsonpatch:jar:0.3.0
+- io.javaoperatorsdk:operator-framework-core:jar:4.1.0
+- io.javaoperatorsdk:operator-framework-framework-core:jar:0.2.0
+- io.javaoperatorsdk:operator-framework:jar:4.1.0
 - org.apache.commons:commons-compress:1.21
 - org.apache.commons:commons-lang3:3.12.0
 - org.apache.commons:commons-math3:3.6.1
@@ -62,11 +65,10 @@ This project bundles the following dependencies under the Apache Software Licens
 - org.objenesis:objenesis:2.1
 - org.slf4j:slf4j-api:1.7.36
 - org.xerial.snappy:snappy-java:1.1.8.3
-- org.yaml:snakeyaml:1.32
+- org.yaml:snakeyaml:1.33
 
 This project bundles the following dependencies under the BSD License.
 See bundled license files for details.
 
 - com.esotericsoftware.kryo:kryo:2.24.0
 - com.esotericsoftware.minlog:minlog:1.2
-- dk.brics.automaton:automaton:1.11-8
diff --git a/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/TestUtils.java b/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/TestUtils.java
index 7e2605a2..aac61d84 100644
--- a/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/TestUtils.java
+++ b/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/TestUtils.java
@@ -40,8 +40,10 @@ import io.fabric8.kubernetes.api.model.apps.DeploymentStatus;
 import io.fabric8.mockwebserver.utils.ResponseProvider;
 import io.javaoperatorsdk.operator.api.config.ControllerConfiguration;
 import io.javaoperatorsdk.operator.api.reconciler.Context;
+import io.javaoperatorsdk.operator.api.reconciler.ResourceDiscriminator;
 import io.javaoperatorsdk.operator.api.reconciler.RetryInfo;
 import io.javaoperatorsdk.operator.api.reconciler.dependent.managed.ManagedDependentResourceContext;
+import io.javaoperatorsdk.operator.processing.event.EventSourceRetriever;
 import okhttp3.Headers;
 import okhttp3.mockwebserver.RecordedRequest;
 import org.junit.jupiter.api.Assertions;
@@ -315,6 +317,12 @@ public class TestUtils extends BaseTestUtils {
             return Optional.empty();
         }
 
+        @Override
+        public <R> Optional<R> getSecondaryResource(
+                Class<R> aClass, ResourceDiscriminator<R, T> resourceDiscriminator) {
+            return Optional.empty();
+        }
+
         @Override
         public ControllerConfiguration<T> getControllerConfiguration() {
             return null;
@@ -324,5 +332,10 @@ public class TestUtils extends BaseTestUtils {
         public ManagedDependentResourceContext managedDependentResourceContext() {
             return null;
         }
+
+        @Override
+        public EventSourceRetriever<T> eventSourceRetriever() {
+            return null;
+        }
     }
 }
diff --git a/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/metrics/KubernetesClientMetricsTest.java b/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/metrics/KubernetesClientMetricsTest.java
index 9a87f699..8bacff26 100644
--- a/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/metrics/KubernetesClientMetricsTest.java
+++ b/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/metrics/KubernetesClientMetricsTest.java
@@ -70,8 +70,8 @@ public class KubernetesClientMetricsTest {
             String.join(".", KUBE_CLIENT_GROUP, HTTP_RESPONSE_GROUP, COUNTER);
     private static final String RESPONSE_METER_ID =
             String.join(".", KUBE_CLIENT_GROUP, HTTP_RESPONSE_GROUP, METER);
-    private static final String RESPONSE_200_COUNTER_ID =
-            String.join(".", KUBE_CLIENT_GROUP, HTTP_RESPONSE_GROUP, "200", COUNTER);
+    private static final String RESPONSE_201_COUNTER_ID =
+            String.join(".", KUBE_CLIENT_GROUP, HTTP_RESPONSE_GROUP, "201", COUNTER);
     private static final String RESPONSE_404_COUNTER_ID =
             String.join(".", KUBE_CLIENT_GROUP, HTTP_RESPONSE_GROUP, "404", COUNTER);
     private static final String RESPONSE_LATENCY_ID =
@@ -157,7 +157,7 @@ public class KubernetesClientMetricsTest {
                 1, listener.getCounter(listener.getMetricId(RESPONSE_COUNTER_ID)).get().getCount());
         assertEquals(
                 1,
-                listener.getCounter(listener.getMetricId(RESPONSE_200_COUNTER_ID))
+                listener.getCounter(listener.getMetricId(RESPONSE_201_COUNTER_ID))
                         .get()
                         .getCount());
         assertTrue(
diff --git a/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/utils/FlinkUtilsTest.java b/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/utils/FlinkUtilsTest.java
index 418bcb33..4ec8ee05 100644
--- a/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/utils/FlinkUtilsTest.java
+++ b/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/utils/FlinkUtilsTest.java
@@ -42,7 +42,6 @@ import java.util.Map;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /** FlinkUtilsTest. */
@@ -101,7 +100,7 @@ public class FlinkUtilsTest {
                 .andReturn(HttpURLConnection.HTTP_INTERNAL_ERROR, new ConfigMapBuilder().build())
                 .once();
         createHAConfigMapWithData(name, clusterId, null);
-        assertNull(kubernetesClient.configMaps().withName(name).get().getData());
+        assertTrue(kubernetesClient.configMaps().withName(name).get().getData().isEmpty());
         FlinkUtils.deleteJobGraphInKubernetesHA(
                 clusterId, kubernetesClient.getNamespace(), kubernetesClient);
     }
@@ -136,6 +135,6 @@ public class FlinkUtilsTest {
                         .withData(data)
                         .build();
 
-        kubernetesClient.configMaps().create(kubernetesConfigMap);
+        kubernetesClient.configMaps().resource(kubernetesConfigMap).createOrReplace();
     }
 }
diff --git a/flink-kubernetes-standalone/pom.xml b/flink-kubernetes-standalone/pom.xml
index c84092b3..462a6610 100644
--- a/flink-kubernetes-standalone/pom.xml
+++ b/flink-kubernetes-standalone/pom.xml
@@ -37,7 +37,7 @@ under the License.
         <dependency>
             <groupId>io.fabric8</groupId>
             <artifactId>kubernetes-client</artifactId>
-            <version>${fabric8.version}</version>
+            <version>5.12.3</version>
             <!-- FLINK-29384, can be removed when fabric8 pulls snakeyaml 1.32+ -->
             <exclusions>
                 <exclusion>
@@ -47,7 +47,6 @@ under the License.
             </exclusions>
         </dependency>
 
-        <!-- FLINK-29384, can be removed when fabric8 pulls snakeyaml 1.32+ -->
         <dependency>
             <groupId>org.yaml</groupId>
             <artifactId>snakeyaml</artifactId>
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 4f0563db..ef023346 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
@@ -64,8 +64,6 @@ spec:
                         additionalProperties:
                           type: string
                         type: object
-                      clusterName:
-                        type: string
                       creationTimestamp:
                         type: string
                       deletionGracePeriodSeconds:
@@ -1458,6 +1456,8 @@ spec:
                         type: boolean
                       hostPID:
                         type: boolean
+                      hostUsers:
+                        type: boolean
                       hostname:
                         type: string
                       imagePullSecrets:
@@ -2100,8 +2100,18 @@ spec:
                                     type: string
                                   type: object
                               type: object
+                            matchLabelKeys:
+                              items:
+                                type: string
+                              type: array
                             maxSkew:
                               type: integer
+                            minDomains:
+                              type: integer
+                            nodeAffinityPolicy:
+                              type: string
+                            nodeTaintsPolicy:
+                              type: string
                             topologyKey:
                               type: string
                             whenUnsatisfiable:
@@ -2271,8 +2281,6 @@ spec:
                                           additionalProperties:
                                             type: string
                                           type: object
-                                        clusterName:
-                                          type: string
                                         creationTimestamp:
                                           type: string
                                         deletionGracePeriodSeconds:
@@ -3067,8 +3075,6 @@ spec:
                             additionalProperties:
                               type: string
                             type: object
-                          clusterName:
-                            type: string
                           creationTimestamp:
                             type: string
                           deletionGracePeriodSeconds:
@@ -4461,6 +4467,8 @@ spec:
                             type: boolean
                           hostPID:
                             type: boolean
+                          hostUsers:
+                            type: boolean
                           hostname:
                             type: string
                           imagePullSecrets:
@@ -5103,8 +5111,18 @@ spec:
                                         type: string
                                       type: object
                                   type: object
+                                matchLabelKeys:
+                                  items:
+                                    type: string
+                                  type: array
                                 maxSkew:
                                   type: integer
+                                minDomains:
+                                  type: integer
+                                nodeAffinityPolicy:
+                                  type: string
+                                nodeTaintsPolicy:
+                                  type: string
                                 topologyKey:
                                   type: string
                                 whenUnsatisfiable:
@@ -5274,8 +5292,6 @@ spec:
                                               additionalProperties:
                                                 type: string
                                               type: object
-                                            clusterName:
-                                              type: string
                                             creationTimestamp:
                                               type: string
                                             deletionGracePeriodSeconds:
@@ -6071,8 +6087,6 @@ spec:
                             additionalProperties:
                               type: string
                             type: object
-                          clusterName:
-                            type: string
                           creationTimestamp:
                             type: string
                           deletionGracePeriodSeconds:
@@ -7465,6 +7479,8 @@ spec:
                             type: boolean
                           hostPID:
                             type: boolean
+                          hostUsers:
+                            type: boolean
                           hostname:
                             type: string
                           imagePullSecrets:
@@ -8107,8 +8123,18 @@ spec:
                                         type: string
                                       type: object
                                   type: object
+                                matchLabelKeys:
+                                  items:
+                                    type: string
+                                  type: array
                                 maxSkew:
                                   type: integer
+                                minDomains:
+                                  type: integer
+                                nodeAffinityPolicy:
+                                  type: string
+                                nodeTaintsPolicy:
+                                  type: string
                                 topologyKey:
                                   type: string
                                 whenUnsatisfiable:
@@ -8278,8 +8304,6 @@ spec:
                                               additionalProperties:
                                                 type: string
                                               type: object
-                                            clusterName:
-                                              type: string
                                             creationTimestamp:
                                               type: string
                                             deletionGracePeriodSeconds:
diff --git a/pom.xml b/pom.xml
index db0d3bdc..7456a6ef 100644
--- a/pom.xml
+++ b/pom.xml
@@ -71,10 +71,11 @@ under the License.
         <maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
         <git-commit-id-maven-plugin.version>5.0.0</git-commit-id-maven-plugin.version>
 
-        <operator.sdk.version>3.2.2</operator.sdk.version>
+        <operator.sdk.version>4.1.0</operator.sdk.version>
         <operator.sdk.admission-controller.version>0.2.0</operator.sdk.admission-controller.version>
 
-        <fabric8.version>5.12.3</fabric8.version>
+        <fabric8.version>6.2.0</fabric8.version>
+
         <lombok.version>1.18.22</lombok.version>
         <commons-lang3.version>3.12.0</commons-lang3.version>
         <commons-io.version>2.11.0</commons-io.version>
@@ -92,7 +93,7 @@ under the License.
 
         <okhttp.version>4.10.0</okhttp.version>
 
-        <snakeyaml.version>1.32</snakeyaml.version>
+        <snakeyaml.version>1.33</snakeyaml.version>
     </properties>
 
     <dependencyManagement>


[flink-kubernetes-operator] 02/02: [FLINK-29851] Optimize poms and drop flink-kubernetes-shaded module

Posted by gy...@apache.org.
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

commit 0b82f860739152fef5bc7665d5e56d1484f67ac0
Author: Gyula Fora <g_...@apple.com>
AuthorDate: Thu Nov 3 10:04:43 2022 +0100

    [FLINK-29851] Optimize poms and drop flink-kubernetes-shaded module
---
 Dockerfile                                         |   4 +-
 flink-kubernetes-operator-api/pom.xml              |   2 +-
 flink-kubernetes-operator/pom.xml                  |  15 +--
 .../operator/service/StandaloneFlinkService.java   |  12 +--
 flink-kubernetes-shaded/pom.xml                    | 120 ---------------------
 flink-kubernetes-standalone/pom.xml                | 103 ++++++++++--------
 .../Fabric8FlinkStandaloneKubeClient.java          |  11 +-
 pom.xml                                            |   4 -
 8 files changed, 81 insertions(+), 190 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 64380f0a..e1e90c4c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -28,7 +28,7 @@ RUN --mount=type=cache,target=/root/.m2 mvn -ntp clean install -pl !flink-kubern
 RUN cd /app/tools/license; mkdir jars; cd jars; \
     cp /app/flink-kubernetes-operator/target/flink-kubernetes-operator-*-shaded.jar . && \
     cp /app/flink-kubernetes-webhook/target/flink-kubernetes-webhook-*-shaded.jar . && \
-    cp /app/flink-kubernetes-shaded/target/flink-kubernetes-shaded-*.jar . && \
+    cp /app/flink-kubernetes-standalone/target/flink-kubernetes-shaded-*.jar . && \
     cp -r /app/flink-kubernetes-operator/target/plugins ./plugins && \
     cd ../ && ./collect_license_files.sh ./jars ./licenses-output
 
@@ -46,7 +46,7 @@ RUN groupadd --system --gid=9999 flink && \
 
 COPY --from=build /app/flink-kubernetes-operator/target/$OPERATOR_JAR .
 COPY --from=build /app/flink-kubernetes-webhook/target/$WEBHOOK_JAR .
-COPY --from=build /app/flink-kubernetes-shaded/target/$FLINK_KUBERNETES_SHADED_JAR .
+COPY --from=build /app/flink-kubernetes-standalone/target/$FLINK_KUBERNETES_SHADED_JAR .
 COPY --from=build /app/flink-kubernetes-operator/target/plugins $FLINK_HOME/plugins
 COPY --from=build /app/tools/license/licenses-output/NOTICE .
 COPY --from=build /app/tools/license/licenses-output/licenses ./licenses
diff --git a/flink-kubernetes-operator-api/pom.xml b/flink-kubernetes-operator-api/pom.xml
index c6c28481..f0b5bbd8 100644
--- a/flink-kubernetes-operator-api/pom.xml
+++ b/flink-kubernetes-operator-api/pom.xml
@@ -73,7 +73,7 @@ under the License.
                     <groupId>com.squareup.okhttp3</groupId>
                     <artifactId>*</artifactId>
                 </exclusion>
-              </exclusions>
+            </exclusions>
         </dependency>
 
         <!-- Utils -->
diff --git a/flink-kubernetes-operator/pom.xml b/flink-kubernetes-operator/pom.xml
index 763d46e2..d7a3f41a 100644
--- a/flink-kubernetes-operator/pom.xml
+++ b/flink-kubernetes-operator/pom.xml
@@ -92,15 +92,16 @@ under the License.
 
         <dependency>
             <groupId>org.apache.flink</groupId>
-            <artifactId>flink-kubernetes-shaded</artifactId>
+            <artifactId>flink-kubernetes-standalone</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>io.fabric8</groupId>
-                    <artifactId>*</artifactId>
-                </exclusion>
-            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-kubernetes</artifactId>
+            <version>${flink.version}</version>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
diff --git a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/StandaloneFlinkService.java b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/StandaloneFlinkService.java
index c79536ab..41378a1a 100644
--- a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/StandaloneFlinkService.java
+++ b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/StandaloneFlinkService.java
@@ -99,8 +99,7 @@ public class StandaloneFlinkService extends AbstractFlinkService {
     }
 
     @VisibleForTesting
-    protected FlinkStandaloneKubeClient createNamespacedKubeClient(
-            Configuration configuration, String namespace) {
+    protected FlinkStandaloneKubeClient createNamespacedKubeClient(Configuration configuration) {
         final int poolSize =
                 configuration.get(KubernetesConfigOptions.KUBERNETES_CLIENT_IO_EXECUTOR_POOL_SIZE);
 
@@ -109,17 +108,12 @@ public class StandaloneFlinkService extends AbstractFlinkService {
                         poolSize,
                         new ExecutorThreadFactory("flink-kubeclient-io-for-standalone-service"));
 
-        return new Fabric8FlinkStandaloneKubeClient(
-                configuration,
-                Fabric8FlinkStandaloneKubeClient.createNamespacedKubeClient(namespace),
-                executorService);
+        return Fabric8FlinkStandaloneKubeClient.create(configuration, executorService);
     }
 
     protected void submitClusterInternal(Configuration conf, Mode mode)
             throws ClusterDeploymentException {
-        final String namespace = conf.get(KubernetesConfigOptions.NAMESPACE);
-
-        FlinkStandaloneKubeClient client = createNamespacedKubeClient(conf, namespace);
+        FlinkStandaloneKubeClient client = createNamespacedKubeClient(conf);
         try (final KubernetesStandaloneClusterDescriptor kubernetesClusterDescriptor =
                 new KubernetesStandaloneClusterDescriptor(conf, client)) {
             switch (mode) {
diff --git a/flink-kubernetes-shaded/pom.xml b/flink-kubernetes-shaded/pom.xml
deleted file mode 100644
index 588feaa1..00000000
--- a/flink-kubernetes-shaded/pom.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-  http://www.apache.org/licenses/LICENSE-2.0
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-      <groupId>org.apache.flink</groupId>
-      <artifactId>flink-kubernetes-operator-parent</artifactId>
-      <version>1.3-SNAPSHOT</version>
-      <relativePath>..</relativePath>
-    </parent>
-
-    <artifactId>flink-kubernetes-shaded</artifactId>
-    <name>Flink Kubernetes Shaded</name>
-    <packaging>jar</packaging>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.flink</groupId>
-            <artifactId>flink-kubernetes</artifactId>
-            <version>${flink.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>*</groupId>
-                    <artifactId>*</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.flink</groupId>
-            <artifactId>flink-kubernetes-standalone</artifactId>
-            <version>${project.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>*</groupId>
-                    <artifactId>*</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <!-- FLINK-29384, Since the transitive snakeyaml that we are filtering out from
-            flink-kubernetes was relocated we have to bundle a relocated new version -->
-        <dependency>
-            <groupId>org.yaml</groupId>
-            <artifactId>snakeyaml</artifactId>
-            <version>${snakeyaml.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>*</groupId>
-                    <artifactId>*</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-shade-plugin</artifactId>
-                <version>3.3.0</version>
-                <executions>
-                    <execution>
-                        <id>shade-flink-operator</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>shade</goal>
-                        </goals>
-                        <configuration>
-                            <artifactSet>
-                                <includes combine.children="append">
-                                    <include>*:*</include>
-                                </includes>
-                            </artifactSet>
-                            <relocations>
-                                <relocation>
-                                    <pattern>io.fabric8</pattern>
-                                    <shadedPattern>org.apache.flink.kubernetes.shaded.io.fabric8</shadedPattern>
-                                </relocation>
-                                <!-- FLINK-29384, Since the transitive snakeyaml that we are filtering out from
-                                    flink-kubernetes was relocated we have to bundle a relocated new version -->
-                                <relocation>
-                                    <pattern>org.yaml.snakeyaml</pattern>
-                                    <shadedPattern>org.apache.flink.kubernetes.shaded.org.yaml.snakeyaml</shadedPattern>
-                                </relocation>
-                            </relocations>
-                            <filters>
-                                <filter>
-                                    <artifact>*:*</artifact>
-                                    <excludes>
-                                        <exclude>META-INF/DEPENDENCIES</exclude>
-                                        <exclude>META-INF/LICENSE</exclude>
-                                        <exclude>META-INF/MANIFEST.MF</exclude>
-                                        <exclude>org/apache/flink/kubernetes/shaded/org/yaml/snakeyaml/**</exclude>
-                                    </excludes>
-                                </filter>
-                            </filters>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/flink-kubernetes-standalone/pom.xml b/flink-kubernetes-standalone/pom.xml
index 462a6610..57916fbf 100644
--- a/flink-kubernetes-standalone/pom.xml
+++ b/flink-kubernetes-standalone/pom.xml
@@ -34,41 +34,26 @@ under the License.
     <packaging>jar</packaging>
 
     <dependencies>
+
         <dependency>
-            <groupId>io.fabric8</groupId>
-            <artifactId>kubernetes-client</artifactId>
-            <version>5.12.3</version>
-            <!-- FLINK-29384, can be removed when fabric8 pulls snakeyaml 1.32+ -->
-            <exclusions>
-                <exclusion>
-                    <groupId>org.yaml</groupId>
-                    <artifactId>snakeyaml</artifactId>
-                </exclusion>
-            </exclusions>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-kubernetes</artifactId>
+            <version>${flink.version}</version>
         </dependency>
 
+        <!-- FLINK-29384, Since the transitive snakeyaml that we are filtering out from
+            flink-kubernetes was relocated we have to bundle a relocated new version -->
         <dependency>
             <groupId>org.yaml</groupId>
             <artifactId>snakeyaml</artifactId>
             <version>${snakeyaml.version}</version>
         </dependency>
 
-        <dependency>
-            <groupId>org.apache.flink</groupId>
-            <artifactId>flink-kubernetes</artifactId>
-            <version>${flink.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>*</groupId>
-                    <artifactId>*</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-
         <dependency>
             <groupId>org.apache.flink</groupId>
             <artifactId>flink-clients</artifactId>
             <version>${flink.version}</version>
+            <scope>provided</scope>
         </dependency>
 
         <!-- Test -->
@@ -92,28 +77,56 @@ under the License.
             <version>${fabric8.version}</version>
             <scope>test</scope>
         </dependency>
-
-        <!-- okhttp -->
-        <!--
-            Regarding the okhttp explicit version
-            see https://github.com/fabric8io/kubernetes-client/issues/4290
-            and https://issues.apache.org/jira/browse/FLINK-28637
-            -->
-        <dependency>
-            <groupId>com.squareup.okhttp3</groupId>
-            <artifactId>okhttp</artifactId>
-            <version>${okhttp.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.squareup.okhttp3</groupId>
-            <artifactId>logging-interceptor</artifactId>
-            <version>${okhttp.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.squareup.okhttp3</groupId>
-            <artifactId>mockwebserver</artifactId>
-            <version>${okhttp.version}</version>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>3.3.0</version>
+                <executions>
+                    <execution>
+                        <id>shade-flink-operator</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <finalName>flink-kubernetes-shaded-${project.version}</finalName>
+                            <artifactSet>
+                                <includes combine.children="append">
+                                    <include>org.apache.flink:flink-kubernetes</include>
+                                    <include>org.yaml:snakeyaml</include>
+                                </includes>
+                            </artifactSet>
+                            <relocations>
+                                <relocation>
+                                    <pattern>io.fabric8</pattern>
+                                    <shadedPattern>org.apache.flink.kubernetes.shaded.io.fabric8</shadedPattern>
+                                </relocation>
+                                <!-- FLINK-29384, Since the transitive snakeyaml that we are filtering out from
+                                    flink-kubernetes was relocated we have to bundle a relocated new version -->
+                                <relocation>
+                                    <pattern>org.yaml.snakeyaml</pattern>
+                                    <shadedPattern>org.apache.flink.kubernetes.shaded.org.yaml.snakeyaml</shadedPattern>
+                                </relocation>
+                            </relocations>
+                            <filters>
+                                <filter>
+                                    <artifact>*:*</artifact>
+                                    <excludes>
+                                        <exclude>META-INF/DEPENDENCIES</exclude>
+                                        <exclude>META-INF/LICENSE</exclude>
+                                        <exclude>META-INF/MANIFEST.MF</exclude>
+                                        <exclude>org/apache/flink/kubernetes/shaded/org/yaml/snakeyaml/**</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/flink-kubernetes-standalone/src/main/java/org/apache/flink/kubernetes/operator/kubeclient/Fabric8FlinkStandaloneKubeClient.java b/flink-kubernetes-standalone/src/main/java/org/apache/flink/kubernetes/operator/kubeclient/Fabric8FlinkStandaloneKubeClient.java
index 45454dd7..b09b6672 100644
--- a/flink-kubernetes-standalone/src/main/java/org/apache/flink/kubernetes/operator/kubeclient/Fabric8FlinkStandaloneKubeClient.java
+++ b/flink-kubernetes-standalone/src/main/java/org/apache/flink/kubernetes/operator/kubeclient/Fabric8FlinkStandaloneKubeClient.java
@@ -17,7 +17,9 @@
 
 package org.apache.flink.kubernetes.operator.kubeclient;
 
+import org.apache.flink.annotation.VisibleForTesting;
 import org.apache.flink.configuration.Configuration;
+import org.apache.flink.kubernetes.configuration.KubernetesConfigOptions;
 import org.apache.flink.kubernetes.kubeclient.Fabric8FlinkKubeClient;
 import org.apache.flink.kubernetes.operator.utils.StandaloneKubernetesUtils;
 
@@ -35,6 +37,7 @@ public class Fabric8FlinkStandaloneKubeClient extends Fabric8FlinkKubeClient
 
     private final NamespacedKubernetesClient internalClient;
 
+    @VisibleForTesting
     public Fabric8FlinkStandaloneKubeClient(
             Configuration flinkConfig,
             NamespacedKubernetesClient client,
@@ -65,7 +68,11 @@ public class Fabric8FlinkStandaloneKubeClient extends Fabric8FlinkKubeClient
                 .delete();
     }
 
-    public static NamespacedKubernetesClient createNamespacedKubeClient(String namespace) {
-        return new DefaultKubernetesClient().inNamespace(namespace);
+    public static Fabric8FlinkStandaloneKubeClient create(
+            Configuration conf, ExecutorService executorService) {
+        var client =
+                new DefaultKubernetesClient()
+                        .inNamespace(conf.get(KubernetesConfigOptions.NAMESPACE));
+        return new Fabric8FlinkStandaloneKubeClient(conf, client, executorService);
     }
 }
diff --git a/pom.xml b/pom.xml
index 7456a6ef..3f804d50 100644
--- a/pom.xml
+++ b/pom.xml
@@ -52,7 +52,6 @@ under the License.
 
     <modules>
         <module>flink-kubernetes-standalone</module>
-        <module>flink-kubernetes-shaded</module>
         <module>flink-kubernetes-operator</module>
         <module>flink-kubernetes-operator-api</module>
         <module>flink-kubernetes-webhook</module>
@@ -64,7 +63,6 @@ under the License.
     <properties>
         <maven.compiler.source>11</maven.compiler.source>
         <maven.compiler.target>11</maven.compiler.target>
-        <maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version>
         <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
         <maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>
         <maven-failsafe-plugin.version>3.0.0-M5</maven-failsafe-plugin.version>
@@ -84,7 +82,6 @@ under the License.
         <slf4j.version>1.7.36</slf4j.version>
         <log4j.version>2.17.1</log4j.version>
         <junit.jupiter.version>5.8.2</junit.jupiter.version>
-        <jetbrains.version>13.0</jetbrains.version>
 
         <spotless.version>2.4.2</spotless.version>
         <it.skip>true</it.skip>
@@ -92,7 +89,6 @@ under the License.
         <hamcrest.version>1.3</hamcrest.version>
 
         <okhttp.version>4.10.0</okhttp.version>
-
         <snakeyaml.version>1.33</snakeyaml.version>
     </properties>