How to run kubernetes e2e tests?

8/10/2016

I have a kubernetes cluster running with one master and 2 nodes. I want to run e2e tests on this cluster. How should I run it? I tried doing go run hack/e2e.go -v --test but that command wants to create a cluster first and then run the test, while I want to run the tests on my already present cluster. Any idea how should I go ahead with it or what parameters should I pass to e2e tests?

TIA.

-- Pensu
kubernetes

5 Answers

9/3/2017

If what you want to do is run the conformance tests and verify your cluster, you might also consider looking into the tool that Heptio created called sonobuoy, which was created specifically to run the non-destructive conformance tests for Kubernetes 1.7 (or later) in a consistent fashion. Lachlan Everson posted a 6 minute youtube video showing how to use it that I thought was pretty easy to follow, and will get you up and running with it very quickly.

It's configuration driven, so you can turn on/off tests that interest you easily, and includes some plugin driven "get more data about this cluster" sort of setup if you find you want or need to dig more in specific areas.

-- heckj
Source: StackOverflow

8/12/2016
-- Eric Tune
Source: StackOverflow

8/31/2017

An updated link you can find it here: https://github.com/kubernetes/community/blob/master/contributors/devel/e2e-tests.md or you can now use kubetest to run e2e tests.

Update: The easiest way to run e2e tests is by using Heptio's scanner

-- Camil
Source: StackOverflow

5/3/2019

I use this command:

docker run -v $HOME/.kube/config:/kubeconfig \
           --env KUBECONFIG=/kubeconfig \
       k8s.gcr.io/conformance-amd64:v1.14.1 \
           /usr/local/bin/ginkgo \
               --focus="\[Conformance\]" \
               --skip="Alpha|\[(Disruptive|Feature:[^\]]+|Flaky)\]" \
               --noColor=false \
               --flakeAttempts=2 \
           /usr/local/bin/e2e.test -- \
               --repo-root=/kubernetes \
               --provider="skeleton" \
               --kubeconfig="/kubeconfig" \
               --allowed-not-ready-nodes=1
-- towolf
Source: StackOverflow

12/13/2017

You can run the conformance e2e tests as described here: https://github.com/cncf/k8s-conformance/blob/master/instructions.md

if your cluster is running 1.7.X or 1.8.x this approach is easy. Basically you can run curl -L https://raw.githubusercontent.com/cncf/k8s-conformance/master/sonobuoy-conformance.yaml | kubectl apply -f -

-- cpanato
Source: StackOverflow