dongjoon-hyun opened a new pull request #32226:
URL: https://github.com/apache/spark/pull/32226


   ### What changes were proposed in this pull request?
   
   This PR aims to support a new configuration, 
`spark.kubernetes.driver.service.deleteOnTermination`, to clean up `Driver 
Service` resource during app termination.
   
   ### Why are the changes needed?
   
   The K8s service is one of the important resources and sometimes it's 
controlled by quota.
   ```
   $ k describe quota
   Name:       service
   Namespace:  default
   Resource    Used  Hard
   --------    ----  ----
   services    1     3
   ```
   
   Apache Spark creates a service for driver whose lifecycle is the same with 
driver pod.
   It means a new Spark job submission will fails if the number of completed 
Spark jobs equals the number of service quota.
   
   ```
   $ k get pod
   NAME                                                        READY   STATUS   
   RESTARTS   AGE
   org-apache-spark-examples-sparkpi-a32c9278e7061b4d-driver   0/1     
Completed   0          31m
   org-apache-spark-examples-sparkpi-a9f1f578e721ef62-driver   0/1     
Completed   0          78s
   
   $ k get svc
   NAME                                                            TYPE        
CLUSTER-IP   EXTERNAL-IP   PORT(S)                      AGE
   kubernetes                                                      ClusterIP   
10.96.0.1    <none>        443/TCP                      80m
   org-apache-spark-examples-sparkpi-a32c9278e7061b4d-driver-svc   ClusterIP   
None         <none>        7078/TCP,7079/TCP,4040/TCP   31m
   org-apache-spark-examples-sparkpi-a9f1f578e721ef62-driver-svc   ClusterIP   
None         <none>        7078/TCP,7079/TCP,4040/TCP   80s
   
   $ k describe quota
   Name:       service
   Namespace:  default
   Resource    Used  Hard
   --------    ----  ----
   services    3     3
   
   $ bin/spark-submit...
   Exception in thread "main" 
io.fabric8.kubernetes.client.KubernetesClientException:
   Failure executing: POST at: 
https://192.168.64.50:8443/api/v1/namespaces/default/services.
   Message: Forbidden! User minikube doesn't have permission.
   services "org-apache-spark-examples-sparkpi-843f6978e722819c-driver-svc" is 
forbidden:
   exceeded quota: service, requested: services=1, used: services=3, limited: 
services=3.
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, this PR adds a new configuration, 
`spark.kubernetes.driver.service.deleteOnTermination`, and enables it by 
default.
   The change is documented at the migration guide.
   
   ### How was this patch tested?
   
   Manually.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to