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

[KYUUBI #5237] ConfigMaps deletion on Kubernetes #6700

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Madhukar525722
Copy link
Contributor

🔍 Description

Issue References 🔗

This pull request fixes #5237

Describe Your Solution 🔧

Extended the implementation of pod deletion method and which deletes the config maps associated with the pod, if the config map contains spark-exec keyword in it. Here I used specific matching to avoid the deletion of any other important config maps

Types of changes 🔖

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Test Plan 🧪

Locally, attaching the results
kyuubi_pod_deletion


Checklist 📝

Be nice. Be informative.

@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (8e2b1b3) to head (c729e2d).
Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
...kyuubi/engine/KubernetesApplicationOperation.scala 0.00% 33 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master   #6700   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files         684     684           
  Lines       42279   42315   +36     
  Branches     5765    5774    +9     
======================================
- Misses      42279   42315   +36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Madhukar525722
Copy link
Contributor Author

Hi @pan3793 @turboFei , please review the change

@pan3793
Copy link
Member

pan3793 commented Sep 17, 2024

The overall design here is, in Spark on K8s cluster mode, all resources created by the Spark app should set the owner reference to the Spark driver pod, which means all resources will be deleted automatically after deleting the driver Pod, is this not sufficient? Can you elaborate more about your use cases and problems?

@Madhukar525722
Copy link
Contributor Author

Madhukar525722 commented Sep 17, 2024

Hi @pan3793, As per my understanding I was expecting the same behaviour, cm to be deleted by spark.
But what I am observing that, driver configs are getting deleted, not executor configs.

While launching the kyuubi-server I have defined, spark.submit.deployMode=cluster

This is the engine launch submit command:

/opt/spark/bin/spark-submit
--class org.apache.kyuubi.engine.spark.SparkSQLEngine
--conf spark.hive.server2.thrift.resultset.default.fetch.size=1000
--conf spark.kyuubi.engine.engineLog.path=/opt/kyuubi/work/madlnu/kyuubi-spark-sql-engine.log.3
--conf spark.kyuubi.engine.submit.time=1726597018098
--conf spark.kyuubi.ha.engine.ref.id=1218c38d-f742-402e-84bf-161b89552eb6
--conf spark.kyuubi.ha.namespace=/kyuubi_1.9.1-SNAPSHOT_USER_SPARK_SQL/madlnu/default
--conf spark.kyuubi.ha.zookeeper.auth.type=NONE
--conf spark.kyuubi.kubernetes.master.address=$MASTER
--conf spark.kyuubi.kubernetes.namespace=scaas
--conf spark.kyuubi.server.ipAddress=0.0.0.0
--conf spark.kyuubi.session.connection.url=0.0.0.0:10009
--conf spark.kyuubi.session.engine.initialize.timeout=PT10M
--conf spark.kyuubi.session.real.user=madlnu
--conf spark.kyuubi.zookeeper.embedded.client.port=2181
--conf spark.app.name=kyuubi_USER_SPARK_SQL_madlnu_default_1218c38d-f742-402e-84bf-161b89552eb6
--conf spark.driver.extraJavaOptions=-Divy.home=/tmp
--conf spark.driver.port=7078
--conf spark.eventLog.enabled=true
--conf spark.hadoop.scaas.skipDeleteOnTerminationValidation=true
--conf spark.kubernetes.authenticate.driver.serviceAccountName=spark
--conf spark.kubernetes.authenticate.serviceAccountName=spark
--conf spark.kubernetes.container.image=$IMAGE
--conf spark.kubernetes.driver.label.kyuubi-unique-tag=1218c38d-f742-402e-84bf-161b89552eb6
--conf spark.kubernetes.driver.pod.name=kyuubi-user-spark-sql-madlnu-default-1218c38d-f742-402e-84bf-161b89552eb6-driver
--conf spark.kubernetes.executor.deleteOnTermination=false
--conf spark.kubernetes.executor.podNamePrefix=kyuubi-user-spark-sql-madlnu-default-1218c38d-f742-402e-84bf-161b89552eb6
--conf spark.kubernetes.namespace=scaas
--conf spark.rpc.askTimeout=300
--conf spark.security.credentials.hbase.enabled=false
--conf spark.submit.deployMode=cluster
--conf spark.kubernetes.driverEnv.SPARK_USER_NAME=madlnu
--conf spark.executorEnv.SPARK_USER_NAME=madlnu
--proxy-user madlnu /opt/kyuubi/externals/engines/spark/kyuubi-spark-sql-engine_2.12-1.9.1-SNAPSHOT.jar

@@ -320,6 +320,39 @@ class KubernetesApplicationOperation extends ApplicationOperation with Logging {
appStateSource,
appStateContainer)
}

try {
val volumes = pod.getSpec.getVolumes.asScala
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might take time to make this action, could you use executor service/thread pool?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @turboFei , I have implemented it using ThreadPool, could you please review. Was it the expectation?

@@ -320,6 +365,8 @@ class KubernetesApplicationOperation extends ApplicationOperation with Logging {
appStateSource,
appStateContainer)
}

runConfigMapDeletion(pod, kubernetesInfo)
Copy link
Member

@turboFei turboFei Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

questions:

Do the executors belong to the same app share the configmap?

If that, on executor pod deleted, you will delete the shared the configmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RangerSparkExtension - ConfigMaps not deleted on Kubernetes
4 participants