apache-spark-on-k8s / spark

Apache Spark enhanced with native Kubernetes scheduler back-end: NOTE this repository is being ARCHIVED as all new development for the kubernetes scheduler back-end is now on https://github.com/apache/spark/
https://spark.apache.org/
Apache License 2.0
612 stars 118 forks source link

V0.2 dev #341

Closed duyanghao closed 7 years ago

duyanghao commented 7 years ago

What changes were proposed in this pull request?

Set driver and executor Label:spark-app-id = --conf spark.kubernetes.driver.pod.name. The main reason for this is that we can search all pods for a spark application with the specified label(spark-app-id) value through par spark.kubernetes.driver.pod.name,which can be more easily combined with web server(if there is any),guess that use A specifies par --conf spark.kubernetes.driver.pod.name=xxx,then web server could get all pods information through k8s with label:spark-app-id=xxx,that is good anyway!!! Refs here.

How was this patch tested?

Manual tests were successful.Example is as follows:

i submit with pars:

--conf spark.kubernetes.driver.pod.name=spark-pi-today-a
--conf spark.executor.cores=2

then driver pod name and labels will be:

kubectl describe pods/spark-pi-today-a
Name:       spark-pi-today-a
Namespace:  default
Node:       xxx
Start Time: Tue, 06 Jun 2017 11:12:01 +0800
Labels:     spark-app-id=spark-pi-today-a
        spark-app-name=spark-pi
        spark-role=driver
Status:     Succeeded

executor #1 pod name and labels will be:

kubectl describe pods/spark-pi-today-a-exec-1
Name:       spark-pi-today-a-exec-1
Namespace:  default
Node:       xxx
Start Time: Tue, 06 Jun 2017 11:12:33 +0800
Labels:     spark-app-id=spark-pi-today-a
        spark-exec-id=1
        spark-role=executor
Status:     Succeeded

executor #2 pod name and labels will be:

kubectl describe pods/spark-pi-today-a-exec-2
Name:       spark-pi-today-a-exec-2
Namespace:  default
Node:       xxx
Start Time: Tue, 06 Jun 2017 11:12:33 +0800
Labels:     spark-app-id=spark-pi-today-a
        spark-exec-id=2
        spark-role=executor
Status:     Succeeded
ash211 commented 7 years ago

@duyanghao is this PR still active? I'm not sure what's left since some of the pieces have been merged in through separate PRs.

If there are still changes that need to be made, please open a new PR against branch-2.2-kubernetes so we can get those merged in to this repo.

I figured that between fixing merge conflicts and changing the destination branch from 2.1 to 2.2 it's easier to start a new PR than continue working on this one.

Thanks again for helping make this project better!