@@ -42,11 +42,12 @@ are set up as described above:
4242 --conf spark.kubernetes.executor.docker.image=registry-host:5000/spark-executor:latest \
4343 examples/jars/spark_examples_2.11-2.2.0.jar
4444
45- <!-- TODO master should default to https if no scheme is specified -->
4645The Spark master, specified either via passing the ` --master ` command line argument to ` spark-submit ` or by setting
4746` spark.master ` in the application's configuration, must be a URL with the format ` k8s://<api_server_url> ` . Prefixing the
4847master string with ` k8s:// ` will cause the Spark application to launch on the Kubernetes cluster, with the API server
49- being contacted at ` api_server_url ` . The HTTP protocol must also be specified.
48+ being contacted at ` api_server_url ` . If no HTTP protocol is specified in the URL, it defaults to ` https ` . For example,
49+ setting the master to ` k8s://example.com:443 ` is equivalent to setting it to ` k8s://https://example.com:443 ` , but to
50+ connect without SSL on a different port, the master would be set to ` k8s://http://example.com:8443 ` .
5051
5152Note that applications can currently only be executed in cluster mode, where the driver and its executors are running on
5253the cluster.
@@ -58,17 +59,18 @@ disk of the submitter's machine. These two types of dependencies are specified v
5859` spark-submit ` :
5960
6061* Local jars provided by specifying the ` --jars ` command line argument to ` spark-submit ` , or by setting ` spark.jars ` in
61- the application's configuration, will be treated as jars that are located on the * disk of the driver Docker
62- container * . This only applies to jar paths that do not specify a scheme or that have the scheme ` file:// ` . Paths with
63- other schemes are fetched from their appropriate locations.
62+ the application's configuration, will be treated as jars that are located on the * disk of the driver container * . This
63+ only applies to jar paths that do not specify a scheme or that have the scheme ` file:// ` . Paths with other schemes are
64+ fetched from their appropriate locations.
6465* Local jars provided by specifying the ` --upload-jars ` command line argument to ` spark-submit ` , or by setting
6566 ` spark.kubernetes.driver.uploads.jars ` in the application's configuration, will be treated as jars that are located on
6667 the * disk of the submitting machine* . These jars are uploaded to the driver docker container before executing the
6768 application.
68- <!-- TODO support main resource bundled in the Docker image -->
6969* A main application resource path that does not have a scheme or that has the scheme ` file:// ` is assumed to be on the
7070 * disk of the submitting machine* . This resource is uploaded to the driver docker container before executing the
7171 application. A remote path can still be specified and the resource will be fetched from the appropriate location.
72+ * A main application resource path that has the scheme ` container:// ` is assumed to be on the * disk of the driver
73+ container* .
7274
7375In all of these cases, the jars are placed on the driver's classpath, and are also sent to the executors. Below are some
7476examples of providing application dependencies.
@@ -78,8 +80,7 @@ To submit an application with both the main resource and two other jars living o
7880 bin/spark-submit \
7981 --deploy-mode cluster \
8082 --class com.example.applications.SampleApplication \
81- --master k8s://https://192.168.99.100 \
82- --kubernetes-namespace default \
83+ --master k8s://192.168.99.100 \
8384 --upload-jars /home/exampleuser/exampleapplication/dep1.jar,/home/exampleuser/exampleapplication/dep2.jar \
8485 --conf spark.kubernetes.driver.docker.image=registry-host:5000/spark-driver:latest \
8586 --conf spark.kubernetes.executor.docker.image=registry-host:5000/spark-executor:latest \
@@ -91,8 +92,7 @@ Note that since passing the jars through the `--upload-jars` command line argume
9192 bin/spark-submit \
9293 --deploy-mode cluster \
9394 --class com.example.applications.SampleApplication \
94- --master k8s://https://192.168.99.100 \
95- --kubernetes-namespace default \
95+ --master k8s://192.168.99.100 \
9696 --conf spark.kubernetes.driver.uploads.jars=/home/exampleuser/exampleapplication/dep1.jar,/home/exampleuser/exampleapplication/dep2.jar \
9797 --conf spark.kubernetes.driver.docker.image=registry-host:5000/spark-driver:latest \
9898 --conf spark.kubernetes.executor.docker.image=registry-host:5000/spark-executor:latest \
@@ -104,8 +104,7 @@ is located in the jar `/opt/spark-plugins/app-plugin.jar` on the docker image's
104104 bin/spark-submit \
105105 --deploy-mode cluster \
106106 --class com.example.applications.PluggableApplication \
107- --master k8s://https://192.168.99.100 \
108- --kubernetes-namespace default \
107+ --master k8s://192.168.99.100 \
109108 --jars /opt/spark-plugins/app-plugin.jar \
110109 --conf spark.kubernetes.driver.docker.image=registry-host:5000/spark-driver-custom:latest \
111110 --conf spark.kubernetes.executor.docker.image=registry-host:5000/spark-executor:latest \
@@ -117,13 +116,22 @@ Spark property, the above will behave identically to this command:
117116 bin/spark-submit \
118117 --deploy-mode cluster \
119118 --class com.example.applications.PluggableApplication \
120- --master k8s://https://192.168.99.100 \
121- --kubernetes-namespace default \
119+ --master k8s://192.168.99.100 \
122120 --conf spark.jars=file:///opt/spark-plugins/app-plugin.jar \
123121 --conf spark.kubernetes.driver.docker.image=registry-host:5000/spark-driver-custom:latest \
124122 --conf spark.kubernetes.executor.docker.image=registry-host:5000/spark-executor:latest \
125123 http://example.com:8080/applications/sparkpluggable/app.jar
126124
125+ To specify a main application resource that is in the Docker image, and if it has no other dependencies:
126+
127+ bin/spark-submit \
128+ --deploy-mode cluster \
129+ --class com.example.applications.PluggableApplication \
130+ --master k8s://192.168.99.100:8443 \
131+ --conf spark.kubernetes.driver.docker.image=registry-host:5000/spark-driver-custom:latest \
132+ --conf spark.kubernetes.executor.docker.image=registry-host:5000/spark-executor:latest \
133+ container:///home/applications/examples/example.jar
134+
127135### Spark Properties
128136
129137Below are some other common properties that are specific to Kubernetes. Most of the other configurations are the same
@@ -133,10 +141,9 @@ from the other deployment modes. See the [configuration page](configuration.html
133141<tr ><th >Property Name</th ><th >Default</th ><th >Meaning</th ></tr >
134142<tr >
135143 <td ><code >spark.kubernetes.namespace</code ></td >
136- <!-- TODO set default to "default" -->
137- <td >(none)</td >
144+ <td ><code >default</code ></td >
138145 <td >
139- The namespace that will be used for running the driver and executor pods. Must be specified. When using
146+ The namespace that will be used for running the driver and executor pods. When using
140147 <code>spark-submit</code> in cluster mode, this can also be passed to <code>spark-submit</code> via the
141148 <code>--kubernetes-namespace</code> command line argument.
142149 </td >
@@ -196,14 +203,6 @@ from the other deployment modes. See the [configuration page](configuration.html
196203 mode. Refer to <a href="running-on-kubernetes.html#adding-other-jars">adding other jars</a> for more information.
197204 </td >
198205</tr >
199- <tr >
200- <!-- TODO remove this functionality -->
201- <td ><code >spark.kubernetes.driver.uploads.driverExtraClasspath</code ></td >
202- <td >(none)</td >
203- <td >
204- Comma-separated list of jars to be sent to the driver only when submitting the application in cluster mode.
205- </td >
206- </tr >
207206<tr >
208207 <td ><code >spark.kubernetes.executor.memoryOverhead</code ></td >
209208 <td >executorMemory * 0.10, with minimum of 384 </td >
0 commit comments