You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that `spark-base` is the base image for the other images. It must be built first before the other images, and then afterwards the other images can be built in any order.
74
74
75
75
## Submitting Applications to Kubernetes
@@ -198,10 +198,10 @@ is currently supported.
198
198
199
199
### Running PySpark
200
200
201
-
Running PySpark on Kubernetes leverages the same spark-submit logic when launching on Yarn and Mesos.
202
-
Python files can be distributed by including, in the conf, `--py-files`
201
+
Running PySpark on Kubernetes leverages the same spark-submit logic when launching on Yarn and Mesos.
202
+
Python files can be distributed by including, in the conf, `--py-files`
203
203
204
-
Below is an example submission:
204
+
Below is an example submission:
205
205
206
206
207
207
```
@@ -265,6 +265,37 @@ other cluster managers.
265
265
266
266
## Advanced
267
267
268
+
### Running in-cluster client mode applications
269
+
270
+
While Spark on Kubernetes does not support client mode applications, such as the PySpark shell, when launched from outside Kubernetes, Spark on Kubernetes does support client mode applications launched from within the cluster. This _in-cluster_ client mode bypasses some of the networking and dependency issues inherent to running a client from outside of a cluster while allowing much of the same functionality in terms of interactive use cases, such as the PySpark shell and Jupyter notebooks.
271
+
272
+
In order to run in client mode, use `kubectl attach` to attach to an existing driver pod on the cluster, or the following to run a new driver:
273
+
274
+
kubectl run -it --image=<driver image> --restart=Never -- /bin/bash
275
+
276
+
This will open up a shell into the specified driver pod from which you can run client mode applications. In order to appropriately configure
277
+
these in-cluster applications, be sure to set the following configuration value for all applications, as in the following `spark-submit` example,
278
+
which tells the cluster manager to refer back to the current driver pod as the driver for any applications you submit:
279
+
280
+
spark.kubernetes.driver.pod.name=$HOSTNAME
281
+
282
+
With that set, you should be able to run the following example from within the pod:
0 commit comments