1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->
<!-- BEGIN STRIP_FOR_RELEASE -->
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">
<h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2>
If you are using a released version of Kubernetes, you should
refer to the docs that go with that version.
Documentation for other releases can be found at
[releases.k8s.io](http://releases.k8s.io).
</strong>
--
<!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING -->
# Node End-To-End tests
Node e2e tests start kubelet and minimal supporting infrastructure to validate the kubelet on a host.
Tests can be run either locally, against a remote host or against a GCE image.
*Note: Linux only. Mac and Windows unsupported.*
## Running tests locally
etcd must be installed and on the PATH to run the node e2e tests. To verify etcd is installed: `which etcd`.
You can find instructions for installing etcd [on the etcd releases page](https://github.com/coreos/etcd/releases).
Run the tests locally: `make test_e2e_node`
Running the node e2e tests locally will build the kubernetes go source files and then start the
kubelet, kube-apiserver, and etcd binaries on localhost before executing the ginkgo tests under
test/e2e_node against the local kubelet instance.
## Running tests against a remote host
The node e2e tests can be run against one or more remote hosts using one of
* [e2e-node-jenkins.sh](../../test/e2e_node/jenkins/e2e-node-jenkins.sh) (gce only)
* [run_e2e.go](../../test/e2e_node/runner/run_e2e.go) (requires passwordless ssh and remote passwordless sudo access over ssh)
* using [run_e2e.go](../../test/e2e_node/runner/run_e2e.go) to build a tar.gz and executing on host (requires host access w/ remote sudo)
### Configuring a new remote host for testing
The host must contain a environment capable of supporting a mini-kubernetes cluster. Includes:
* install etcd
* install docker
* install lxc and update grub commandline
* enable tty-less sudo access
See [setup_host.sh](../../test/e2e_node/environment/setup_host.sh)
### Running the tests
1. If running against a host on gce
* Copy [template.properties](../../test/e2e_node/jenkins/template.properties)
* Fill in `GCE_HOSTS`
* Set `INSTALL_GODEP=true` to install `godep`, `gomega`, `ginkgo`
* Make sure host names are resolvable to ssh `ssh <host>`.
* If needed, you can run `gcloud compute config-ssh` to add gce hostnames to your .ssh/config so they are resolvable by ssh.
* Run `test/e2e_node/jenkins/e2e-node-jenkins.sh <path to properties file>`
* **Must be run from kubernetes root**
2. If running against a host anywhere else
* **Requires password-less ssh and sudo access**
* Make sure this works - e.g. `ssh <hostname> -- sudo echo "ok"`
* If ssh flags are required (e.g. `-i`), they can be used and passed to the tests with `--ssh-options`
* `godep go run test/e2e_node/runner/run_e2e.go --logtostderr --hosts <comma separated hosts>`
* **Must be run from kubernetes root**
* requires (go get): `github.com/tools/godep`, `github.com/onsi/gomega`, `github.com/onsi/ginkgo/ginkgo`
3. Alternatively, manually build and copy `e2e_node_test.tar.gz` to a remote host
* Build the tar.gz `godep go run test/e2e_node/runner/run_e2e.go --logtostderr --build-only`
* requires (go get): `github.com/tools/godep`, `github.com/onsi/gomega`, `github.com/onsi/ginkgo/ginkgo`
* Copy `e2e_node_test.tar.gz` to the remote host
* Extract the archive on the remote host `tar -xzvf e2e_node_test.tar.gz`
* Run the tests `./e2e_node.test --logtostderr --vmodule=*=2 --build-services=false --node-name=<hostname>`
* Note: This must be run from the directory containing the kubelet and kube-apiserver binaries.
## Running tests against a gce image
* Build a gce image from a prepared gce host
* Create the host from a base image and configure it (see above)
* Run tests against this remote host to ensure that it is setup correctly before doing anything else
* Create a gce *snapshot* of the instance
* Create a gce *disk* from the snapshot
* Create a gce *image* from the disk
* Test that the necessary gcloud credentials are setup for the project
* `gcloud compute --project <project> --zone <zone> images list`
* Verify that your image appears in the list
* Copy [template.properties](../../test/e2e_node/jenkins/template.properties)
* Fill in `GCE_PROJECT`, `GCE_ZONE`, `GCE_IMAGES`
* Run `test/e2e_node/jenkins/e2e-node-jenkins.sh <path to properties file>`
* **Must be run from kubernetes root**
## Kubernetes Jenkins CI and PR builder
Node e2e tests are run against a static list of host environments continuously or when manually triggered on a github.com
pull requests using the trigger phrase `@k8s-bot test node e2e experimental` - *results not yet publish, pending
evaluation of test stability.*.
### CI Host environments
TBD
### PR builder host environments
| linux distro | distro version | docker version | etcd version | cloud provider |
|-----------------|----------------|----------------|--------------|----------------|
| containervm | | 1.8 | | gce |
| rhel | 7 | 1.10 | | gce |
| centos | 7 | 1.10 | | gce |
| coreos | stable | 1.8 | | gce |
| debian | jessie | 1.10 | | gce |
| ubuntu | trusty | 1.8 | | gce |
| ubuntu | trusty | 1.9 | | gce |
| ubuntu | trusty | 1.10 | | gce |
| ubuntu | wily | 1.10 | | gce |
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[]()
<!-- END MUNGE: GENERATED_ANALYTICS -->
|