Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
turboFei committed Nov 16, 2023
1 parent 0c9ff1a commit 7a98c92
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions docs/configuration/settings.md
Expand Up @@ -322,6 +322,7 @@ You can configure the Kyuubi properties in `$KYUUBI_HOME/conf/kyuubi-defaults.co
| kyuubi.kubernetes.master.address | <undefined> | The internal Kubernetes master (API server) address to be used for kyuubi. | string | 1.7.0 |
| kyuubi.kubernetes.namespace | default | The namespace that will be used for running the kyuubi pods and find engines. | string | 1.7.0 |
| kyuubi.kubernetes.namespace.allow.list || The allowed kubernetes namespace list, if it is empty, there is no kubernetes namespace limitation. | set | 1.8.0 |
| kyuubi.kubernetes.spark.deleteDriverPodOnTermination.enabled | false | If set to true then Kyuubi server will delete the spark driver pod after the application terminates for kyuubi.kubernetes.terminatedApplicationRetainPeriod. | boolean | 1.8.1 |
| kyuubi.kubernetes.spark.forciblyRewriteDriverPodName.enabled | false | Whether to forcibly rewrite Spark driver pod name with 'kyuubi-<uuid>-driver'. If disabled, Kyuubi will try to preserve the application name while satisfying K8s' pod name policy, but some vendors may have stricter pod name policies, thus the generated name may become illegal. | boolean | 1.8.1 |
| kyuubi.kubernetes.spark.forciblyRewriteExecutorPodNamePrefix.enabled | false | Whether to forcibly rewrite Spark executor pod name prefix with 'kyuubi-<uuid>'. If disabled, Kyuubi will try to preserve the application name while satisfying K8s' pod name policy, but some vendors may have stricter Pod name policies, thus the generated name may become illegal. | boolean | 1.8.1 |
| kyuubi.kubernetes.terminatedApplicationRetainPeriod | PT5M | The period for which the Kyuubi server retains application information after the application terminates. | duration | 1.7.1 |
Expand Down
Expand Up @@ -1231,10 +1231,10 @@ object KyuubiConf {
.checkValue(_ > 0, "must be positive number")
.createWithDefault(Duration.ofMinutes(5).toMillis)

val KUBERNETES_TERMINATED_APPLICATION_POD_CLEANUP_ENABLED: ConfigEntry[Boolean] =
buildConf("kyuubi.kubernetes.terminatedApplicationPodCleanupEnabled")
.doc("If set to true then Kyuubi server will clean up the application pod " +
"after the application terminates.")
val KUBERNETES_SPARK_DELETE_DRIVER_POD_ON_TERMINATION_ENABLED: ConfigEntry[Boolean] =
buildConf("kyuubi.kubernetes.spark.deleteDriverPodOnTermination.enabled")
.doc("If set to true then Kyuubi server will delete the spark driver pod after " +
s"the application terminates for ${KUBERNETES_TERMINATED_APPLICATION_RETAIN_PERIOD.key}.")
.version("1.8.1")
.booleanConf
.createWithDefault(false)
Expand Down
Expand Up @@ -99,20 +99,21 @@ class KubernetesApplicationOperation extends ApplicationOperation with Logging {
submitTimeout = conf.get(KyuubiConf.ENGINE_KUBERNETES_SUBMIT_TIMEOUT)
// Defer cleaning terminated application information
val retainPeriod = conf.get(KyuubiConf.KUBERNETES_TERMINATED_APPLICATION_RETAIN_PERIOD)
val cleanupPod = conf.get(KyuubiConf.KUBERNETES_TERMINATED_APPLICATION_POD_CLEANUP_ENABLED)
val deleteSparkDriverPod =
conf.get(KyuubiConf.KUBERNETES_SPARK_DELETE_DRIVER_POD_ON_TERMINATION_ENABLED)
cleanupTerminatedAppInfoTrigger = CacheBuilder.newBuilder()
.expireAfterWrite(retainPeriod, TimeUnit.MILLISECONDS)
.removalListener((notification: RemovalNotification[String, ApplicationState]) => {
Option(appInfoStore.remove(notification.getKey)).foreach { case (kubernetesInfo, removed) =>
if (cleanupPod) {
if (deleteSparkDriverPod) {
try {
val kubernetesClient = getOrCreateKubernetesClient(kubernetesInfo)
val deletedPod = kubernetesClient.pods().withName(removed.name).delete().isEmpty
val deleted = kubernetesClient.pods().withName(removed.name).delete().isEmpty
info(s"[$kubernetesInfo] Operation of delete pod ${removed.name} with" +
s" ${toLabel(notification.getKey)} is completed ? $deletedPod")
s" ${toLabel(notification.getKey)} is completed ? $deleted")
} catch {
case NonFatal(e) => error(
s"[$kubernetesInfo]Failed to delete pod ${removed.name} with" +
s"[$kubernetesInfo] Failed to delete pod ${removed.name} with" +
s" ${toLabel(notification.getKey)}",
e)
}
Expand Down

0 comments on commit 7a98c92

Please sign in to comment.