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 Kubernetes client version 5.12.2 #40

Open
wants to merge 3 commits into
base: v0.6.0-incubating-kubernetes-support
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<spark.scala-2.11.version>2.4.5</spark.scala-2.11.version>
<spark.scala-2.12.version>2.4.5</spark.scala-2.12.version>
<spark.version>${spark.scala-2.11.version}</spark.version>
<kubernetes.client.version>4.6.4</kubernetes.client.version>
<kubernetes.client.version>5.12.2</kubernetes.client.version>
<hive.version>3.0.0</hive.version>
<commons-codec.version>1.9</commons-codec.version>
<httpclient.version>4.5.3</httpclient.version>
Expand All @@ -106,7 +106,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<py4j.version>0.10.7</py4j.version>
<scala-2.11.version>2.11.12</scala-2.11.version>
<scala-2.12.version>2.12.10</scala-2.12.version>
<scala-2.12.version>2.12.15</scala-2.12.version>
<scala.binary.version>2.11</scala.binary.version>
<scala.version>${scala-2.11.version}</scala.version>
<scalatest.version>3.0.8</scalatest.version>
Expand Down Expand Up @@ -651,7 +651,7 @@
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>4.2.0</version>
<version>4.4.0</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -1088,7 +1088,7 @@
https://archive.apache.org/dist/spark/spark-3.0.0/spark-3.0.0-bin-hadoop2.7.tgz
</spark.bin.download.url>
<spark.bin.name>spark-3.0.0-bin-hadoop2.7</spark.bin.name>
<kubernetes.client.version>4.9.2</kubernetes.client.version>
<kubernetes.client.version>5.12.2</kubernetes.client.version>
<jackson.version>2.10.3</jackson.version>
</properties>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import scala.language.postfixOps
import scala.util.{Failure, Success, Try}
import scala.util.control.NonFatal

import io.fabric8.kubernetes.api.model._
import io.fabric8.kubernetes.api.model.extensions.{Ingress, IngressBuilder}
import io.fabric8.kubernetes.api.model.{Pod, Service, HasMetadata, ServiceBuilder, OwnerReferenceBuilder}
import io.fabric8.kubernetes.api.model.networking.v1.{Ingress, IngressBuilder}
import io.fabric8.kubernetes.client.{ConfigBuilder, _}
import org.apache.commons.lang.StringUtils

Expand Down Expand Up @@ -152,7 +152,8 @@ class SparkKubernetesApp private[utils] (

Thread.currentThread().setName(s"kubernetesAppMonitorThread-$appId")
listener.foreach(_.appIdKnown(appId))


info("Build new ingress as per networking api")
if (livyConf.getBoolean(LivyConf.KUBERNETES_INGRESS_CREATE)) {
withRetry(kubernetesClient.createSparkUIIngress(app, livyConf))
}
Expand Down Expand Up @@ -491,7 +492,8 @@ private[utils] object KubernetesExtensions {
.withName(app.getApplicationPod.getMetadata.getName)
.tailingLines(cacheLogSize).getLog.split("\n").toIndexedSeq
).getOrElse(IndexedSeq.empty)
val ingress = client.extensions.ingresses.inNamespace(app.getApplicationNamespace)

val ingress = client.network().v1().ingresses().inNamespace(app.getApplicationNamespace)
.withLabel(SPARK_APP_TAG_LABEL, app.getApplicationTag)
.list.getItems.asScala.headOption
KubernetesAppReport(driver, executors, appLog, ingress, livyConf)
Expand Down Expand Up @@ -538,7 +540,7 @@ private[utils] object KubernetesExtensions {
) ++ additionalAnnotations

val builder = new IngressBuilder()
.withApiVersion("extensions/v1beta1")
.withApiVersion("networking.k8s.io/v1")
.withNewMetadata()
.withName(fixResourceName(s"${app.getApplicationPod.getMetadata.getName}-ui"))
.withNamespace(app.getApplicationNamespace)
Expand All @@ -553,9 +555,14 @@ private[utils] object KubernetesExtensions {
.addNewPath()
.withPath(s"/$appTag/?(.*)")
.withNewBackend()
.withServiceName(service.getMetadata.getName)
.withNewServicePort(service.getSpec.getPorts.get(0).getName)
.withNewService()
.withName(service.getMetadata.getName)
.withNewPort()
.withName(service.getSpec.getPorts.get(0).getName)
.endPort()
.endService()
.endBackend()
.withPathType("ImplementationSpecific")
.endPath()
.endHttp()
.endRule()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package org.apache.livy.utils

import java.util.Objects._

import io.fabric8.kubernetes.api.model._
import io.fabric8.kubernetes.api.model.extensions.{Ingress, IngressRule, IngressSpec}
import io.fabric8.kubernetes.api.model.{Pod, Service, HasMetadata, ServiceBuilder, OwnerReferenceBuilder, PodStatus, ObjectMeta}
import io.fabric8.kubernetes.api.model.networking.v1.{Ingress, IngressRule, IngressSpec}
import org.mockito.Mockito.when
import org.scalatest.FunSpec
import org.scalatest.mock.MockitoSugar._
Expand Down