Skip to content

Commit

Permalink
Better readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ozdanborne committed May 15, 2017
1 parent 325ba67 commit b6d1ea0
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,37 @@ Step 1: Run the Kubernetes End-to-End Tests.

Step 2: Congratulate yourself on not even having to build Kubernetes first.

### You too can run the k8s-e2e's on your cluster __without having to build Kubernetes first__.
### You too can run the k8s-e2e's on your cluster without having to build Kubernetes first.

With:
#### Run using Docker

To run the e2e's using Docker, volume mount in a populated kubeconfig:

```
docker run --net=host ozdanborne/k8s-e2e
docker run -v ~/.kube/config:/root/kubeconfig ozdanborne/k8s-e2e
```

#### Why `--net=host`?`

Seems that `e2e.test` doesn't just accept the address of your cluster as an argument.
You either have to:

1. Run it as a Pod, in your cluster. Or,
If your apiserver is running at `localhost:8080` with no auth, you can
rely on [the default kubeconfig already at `/root/kubeconfig`](https://github.com/ozdanborne/k8s-e2e-containerized/blob/run-as-plain-container/kubeconfig).

2. Run as a regular ole' container **with a populated kubeconfig**.
```
docker run --net=host ozdanborne/k8s-e2e
```

I took the liberty of building
[a static kubeconfig that connects to a cluster at localhost:8080](https://github.com/ozdanborne/k8s-e2e-containerized/blob/run-as-plain-container/kubeconfig),
just for you.
#### Run using Kubernetes

If you need to connect it to a different cluster, just volume mount your own
kubeconfig in:
You can also run the e2e's as a Kubernetes pod by overriding the default
command with one which leaves out `-kubeconfig`. When omitted, the e2e's will
rely on the `KUBERNETES_SERVICE_HOST` and `KUBERNETES_SERVICE_PORT` which
are set for every pod:

```
docker run -v ~/.kube/config:/root/kubeconfig ozdanborne/k8s-e2e
kubectl run e2e --image=ozdanborne/k8s-e2e --restart=Never --attach -- ./e2e.test --ginkgo.focus="(Networking).*(\[Conformance\])|\[Feature:NetworkPolicy\]"
```

## Future Work

I either need to figure out how to get e2e.test to use the
damn `-host` I'm passing it. Or add some environment variable templating so that
you can inject the apiserver address into the kubeconfig file at runtime.
**Pass Target Apiserver as Param**

It'd be useful to accept an apiserver address as a param at runtime.
Unfortunately, I couldn't get `e2e.test` to use the `-host` passed to it.

0 comments on commit b6d1ea0

Please sign in to comment.