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
{{ message }}
This repository was archived by the owner on Jan 9, 2020. It is now read-only.
* Adding official alpha docker image to docs
* Reorder sections and create a specific one for "advanced"
* Provide limitations and instructions about running on GKE
* Fix title of advanced section: submission
* Improved section on running in the cloud
* Update versioning
* Address comments
* Address comments
(cherry picked from commit e5da90d)
For general information about running Spark on Kubernetes, refer to [running Spark on Kubernetes](running-on-kubernetes.md).
7
+
8
+
A Kubernetes cluster may be brought up on different cloud providers or on premise. It is commonly provisioned through [Google Container Engine](https://cloud.google.com/container-engine/), or using [kops](https://github.com/kubernetes/kops) on AWS, or on premise using [kubeadm](https://kubernetes.io/docs/getting-started-guides/kubeadm/).
9
+
10
+
## Running on Google Container Engine (GKE)
11
+
12
+
* Create a GKE [container cluster](https://cloud.google.com/container-engine/docs/clusters/operations).
13
+
* Obtain kubectl and [configure](https://cloud.google.com/container-engine/docs/clusters/operations#configuring_kubectl) it appropriately.
14
+
* Find the identity of the master associated with this project.
15
+
16
+
> kubectl cluster-info
17
+
Kubernetes master is running at https://<master-ip>:443
18
+
19
+
* Run spark-submit with the master option set to `k8s://https://<master-ip>:443`. The instructions for running spark-submit are provided in the [running on kubernetes](running-on-kubernetes.md) tutorial.
20
+
* Check that your driver pod, and subsequently your executor pods are launched using `kubectl get pods`.
21
+
* Read the stdout and stderr of the driver pod using `kubectl logs <name-of-driver-pod>`, or stream the logs using `kubectl logs -f <name-of-driver-pod>`.
22
+
23
+
Known issues:
24
+
* If you face OAuth token expiry errors when you run spark-submit, it is likely because the token needs to be refreshed. The easiest way to fix this is to run any `kubectl` command, say, `kubectl version` and then retry your submission.
Copy file name to clipboardExpand all lines: docs/running-on-kubernetes.md
+46-30Lines changed: 46 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,28 @@ currently limited and not well-tested. This should not be used in production env
12
12
* You must have appropriate permissions to create and list [pods](https://kubernetes.io/docs/user-guide/pods/), [nodes](https://kubernetes.io/docs/admin/node/) and [services](https://kubernetes.io/docs/user-guide/services/) in your cluster. You can verify that you can list these resources by running `kubectl get nodes`, `kubectl get pods` and `kubectl get svc` which should give you a list of nodes, pods and services (if any) respectively.
13
13
* You must have an extracted spark distribution with Kubernetes support, or build one from [source](https://github.com/apache-spark-on-k8s/spark).
14
14
15
-
## Setting Up Docker Images
15
+
## Driver & Executor Images
16
16
17
17
Kubernetes requires users to supply images that can be deployed into containers within pods. The images are built to
18
18
be run in a container runtime environment that Kubernetes supports. Docker is a container runtime environment that is
19
19
frequently used with Kubernetes, so Spark provides some support for working with Docker to get started quickly.
20
20
21
-
To use Spark on Kubernetes with Docker, images for the driver and the executors need to built and published to an
22
-
accessible Docker registry. Spark distributions include the Docker files for the driver and the executor at
23
-
`dockerfiles/driver/Dockerfile` and `docker/executor/Dockerfile`, respectively. Use these Docker files to build the
21
+
If you wish to use pre-built docker images, you may use the images published in [kubespark](https://hub.docker.com/u/kubespark/). The images are as follows:
You may also build these docker images from sources, or customize them as required. Spark distributions include the Docker files for the driver and the executor at
36
+
`dockerfiles/driver/Dockerfile` and `dockerfiles/executor/Dockerfile`, respectively. Use these Docker files to build the
24
37
Docker images, and then tag them with the registry that the images should be sent to. Finally, push the images to the
The Spark master, specified either via passing the `--master` command line argument to `spark-submit` or by setting
@@ -55,7 +68,6 @@ being contacted at `api_server_url`. If no HTTP protocol is specified in the URL
55
68
setting the master to `k8s://example.com:443` is equivalent to setting it to `k8s://https://example.com:443`, but to
56
69
connect without SSL on a different port, the master would be set to `k8s://http://example.com:8443`.
57
70
58
-
59
71
If you have a Kubernetes cluster setup, one way to discover the apiserver URL is by executing `kubectl cluster-info`.
60
72
61
73
> kubectl cluster-info
@@ -67,33 +79,17 @@ In the above example, the specific Kubernetes cluster can be used with spark sub
67
79
Note that applications can currently only be executed in cluster mode, where the driver and its executors are running on
68
80
the cluster.
69
81
70
-
### Dependency Management and Docker Containers
82
+
### Specifying input files
71
83
72
84
Spark supports specifying JAR paths that are either on the submitting host's disk, or are located on the disk of the
73
85
driver and executors. Refer to the [application submission](submitting-applications.html#advanced-dependency-management)
74
86
section for details. Note that files specified with the `local://` scheme should be added to the container image of both
75
87
the driver and the executors. Files without a scheme or with the scheme `file://` are treated as being on the disk of
76
88
the submitting machine, and are uploaded to the driver running in Kubernetes before launching the application.
77
-
78
-
### Setting Up SSL For Submitting the Driver
79
89
80
-
When submitting to Kubernetes, a pod is started for the driver, and the pod starts an HTTP server. This HTTP server
81
-
receives the driver's configuration, including uploaded driver jars, from the client before starting the application.
82
-
Spark supports using SSL to encrypt the traffic in this bootstrapping process. It is recommended to configure this
83
-
whenever possible.
90
+
### Accessing Kubernetes Clusters
84
91
85
-
See the [security page](security.html) and [configuration](configuration.html) sections for more information on
86
-
configuring SSL; use the prefix `spark.ssl.kubernetes.submit` in configuring the SSL-related fields in the context
87
-
of submitting to Kubernetes. For example, to set the trustStore used when the local machine communicates with the driver
88
-
pod in starting the application, set `spark.ssl.kubernetes.submit.trustStore`.
89
-
90
-
One note about the keyStore is that it can be specified as either a file on the client machine or a file in the
91
-
container image's disk. Thus `spark.ssl.kubernetes.submit.keyStore` can be a URI with a scheme of either `file:`
92
-
or `local:`. A scheme of `file:` corresponds to the keyStore being located on the client machine; it is mounted onto
93
-
the driver container as a [secret volume](https://kubernetes.io/docs/user-guide/secrets/). When the URI has the scheme
94
-
`local:`, the file is assumed to already be on the container's disk at the appropriate path.
95
-
96
-
### Kubernetes Clusters and the authenticated proxy endpoint
92
+
For details about running on public cloud environments, such as Google Container Engine (GKE), refer to [running Spark in the cloud with Kubernetes](running-on-kubernetes-cloud.md).
97
93
98
94
Spark-submit also supports submission through the
99
95
[local kubectl proxy](https://kubernetes.io/docs/user-guide/accessing-the-cluster/#using-kubectl-proxy). One can use the
@@ -112,16 +108,36 @@ If our local proxy were listening on port 8001, we would have our submission loo
0 commit comments