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

linying pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev by this push:
     new 78a9dbca7 use v1 API to create Ingress (#2688)
78a9dbca7 is described below

commit 78a9dbca733602ba3136e241c5816c6b966e4b0c
Author: BIN <[email protected]>
AuthorDate: Mon Apr 24 16:20:06 2023 +0800

    use v1 API to create Ingress (#2688)
---
 .../flink/kubernetes/IngressController.scala       | 23 ++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git 
a/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/IngressController.scala
 
b/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/IngressController.scala
index 135d97cb3..fd758f4d3 100644
--- 
a/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/IngressController.scala
+++ 
b/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/IngressController.scala
@@ -21,7 +21,7 @@ import org.apache.streampark.common.util.Logger
 import org.apache.streampark.common.util.Utils._
 
 import io.fabric8.kubernetes.api.model.{IntOrString, OwnerReferenceBuilder}
-import io.fabric8.kubernetes.api.model.networking.v1beta1.IngressBuilder
+import io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder
 import io.fabric8.kubernetes.client.DefaultKubernetesClient
 import org.apache.commons.io.FileUtils
 import org.apache.flink.client.program.ClusterClient
@@ -89,23 +89,34 @@ object IngressController extends Logger {
           .withNewHttp()
           .addNewPath()
           .withPath(s"/$nameSpace/$clusterId/")
+          .withPathType("ImplementationSpecific")
           .withNewBackend()
-          .withServiceName(s"$clusterId-rest")
-          .withServicePort(new IntOrString("rest"))
+          .withNewService()
+          .withName(s"$clusterId-rest")
+          .withNewPort()
+          .withName("rest")
+          .endPort()
+          .endService()
           .endBackend()
           .endPath()
           .addNewPath()
           .withPath(s"/$nameSpace/$clusterId" + "(/|$)(.*)")
+          .withPathType("ImplementationSpecific")
           .withNewBackend()
-          .withServiceName(s"$clusterId-rest")
-          .withServicePort(new IntOrString("rest"))
+          .withNewService()
+          .withName(s"$clusterId-rest")
+          .withNewPort()
+          .withName("rest")
+          .endPort()
+          .endService()
           .endBackend()
           .endPath()
           .endHttp()
           .endRule()
           .endSpec()
           .build();
-        client.network.ingress.inNamespace(nameSpace).create(ingress)
+        client.network.v1.ingresses().inNamespace(nameSpace).create(ingress)
+
       case _ =>
     }
   }

Reply via email to