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
[SPARK-25809][K8S][TEST] New K8S integration testing backends
## What changes were proposed in this pull request?
Currently K8S integration tests are hardcoded to use a `minikube` based backend. `minikube` is VM based so can be resource hungry and also doesn't cope well with certain networking setups (for example using Cisco AnyConnect software VPN `minikube` is unusable as it detects its own IP incorrectly).
This PR Adds a new K8S integration testing backend that allows for using the Kubernetes support in [Docker for Desktop](https://blog.docker.com/2018/07/kubernetes-is-now-available-in-docker-desktop-stable-channel/). It also generalises the framework to be able to run the integration tests against an arbitrary Kubernetes cluster.
To Do:
- [x] General Kubernetes cluster backend
- [x] Documentation on Kubernetes integration testing
- [x] Testing of general K8S backend
- [x] Check whether change from timestamps being `Time` to `String` in Fabric 8 upgrade needs additional fix up
## How was this patch tested?
Ran integration tests with Docker for Desktop and all passed:

Suggested Reviewers: ifilonenko srowen
Author: Rob Vesse <[email protected]>
Closesapache#22805 from rvesse/SPARK-25809.
Copy file name to clipboardExpand all lines: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/SparkKubernetesClientFactory.scala
Copy file name to clipboardExpand all lines: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/LoggingPodStatusWatcher.scala
@@ -8,26 +8,59 @@ title: Spark on Kubernetes Integration Tests
8
8
Note that the integration test framework is currently being heavily revised and
9
9
is subject to change. Note that currently the integration tests only run with Java 8.
10
10
11
-
The simplest way to run the integration tests is to install and run Minikube, then run the following:
11
+
The simplest way to run the integration tests is to install and run Minikube, then run the following from this
12
+
directory:
12
13
13
14
dev/dev-run-integration-tests.sh
14
15
15
16
The minimum tested version of Minikube is 0.23.0. The kube-dns addon must be enabled. Minikube should
16
-
run with a minimum of 3 CPUs and 4G of memory:
17
+
run with a minimum of 4 CPUs and 6G of memory:
17
18
18
-
minikube start --cpus 3 --memory 4096
19
+
minikube start --cpus 4 --memory 6144
19
20
20
21
You can download Minikube [here](https://github.com/kubernetes/minikube/releases).
21
22
22
23
# Integration test customization
23
24
24
-
Configuration of the integration test runtime is done through passing different arguments to the test script. The main useful options are outlined below.
25
+
Configuration of the integration test runtime is done through passing different arguments to the test script.
26
+
The main useful options are outlined below.
27
+
28
+
## Using a different backend
29
+
30
+
The integration test backend i.e. the K8S cluster used for testing is controlled by the `--deploy-mode` option. By
31
+
default this is set to `minikube`, the available backends are their perequisites are as follows.
32
+
33
+
### `minikube`
34
+
35
+
Uses the local `minikube` cluster, this requires that `minikube` 0.23.0 or greater be installed and that it be allocated
36
+
at least 4 CPUs and 6GB memory (some users have reported success with as few as 3 CPUs and 4GB memory). The tests will
37
+
check if `minikube` is started and abort early if it isn't currently running.
38
+
39
+
### `docker-for-desktop`
40
+
41
+
Since July 2018 Docker for Desktop provide an optional Kubernetes cluster that can be enabled as described in this
Copy file name to clipboardExpand all lines: resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/KubernetesSuite.scala
Copy file name to clipboardExpand all lines: resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/KubernetesTestComponents.scala
0 commit comments