Skip to content
Permalink
Browse files

Modify readme to fit new e2e tests. Modify ci code to replace HELM IM…

…AGE tag.
  • Loading branch information...
hbarkal authored and juliogreff committed Jul 26, 2019
1 parent 9416aed commit 7b1ff3cbefd65920f17d1281b1869cf4319bbffe
Showing with 28 additions and 17 deletions.
  1. +2 −1 ci/e2e.sh
  2. +1 −1 ci/helm.yaml
  3. +25 −15 test/e2e/README.md
@@ -12,7 +12,8 @@ kubectl wait -n container-registry --for=condition=ready pod/$REGISTRY_POD

# Build an image with the test charts and deploy it
HELM_IMAGE=localhost:32000/bookingcom/shipper-helm:latest make helm
kubectl apply -f ci/helm.yaml
sed s=\<HELM_IMAGE\>=localhost:32000/bookingcom/shipper:latest= ci/helm.yaml | \
kubectl apply -f -

# Build an image with shipper and deploy it
SHIPPER_IMAGE=localhost:32000/bookingcom/shipper:latest make shipper
@@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: app
image: localhost:32000/bookingcom/shipper-helm:latest
image: <HELM_IMAGE>
env:
- name: POD_IP
valueFrom:
@@ -5,29 +5,39 @@
These tests assume that they can reach a properly configured Kubernetes cluster
that has Shipper running on it. To setup microk8s into this condition, do
the following:

* If you don't have a `container-registry` namespace, run `microk8s.enable registry` in your microk8s
* In microk8s open file `/var/snap/microk8s/current/args/kube-apiserver`. Look for `--insecure-port=XXXX` (for example 8080)
* In you computer `kubectl config view`. Look for microk8s-cluster, and make sure that the server port is the __insecure__ port from your microk8s (and not the __secure__ port)!
* In you computer `kubectl config view`. Look for microk8s-cluster, and make sure that the server
port is the __insecure__ port from your microk8s (and not the __secure__ port)!
* Disable proxys should help
* Make sure you're using microk8s context (`kubectl config use-context microk8s`)
* `perl hack/install-crds.pl`
* Use shipperctl to configure clusters.
clusters.yaml file should look like:
* Use shipperctl to configure clusters: `go run cmd/shipperctl/main.go admin clusters apply -f ci/clusters.yaml`
* Wait for microk8s.registry to be ready, as we're about to use it
```
REGISTRY_POD=$(kubectl get pod -n container-registry -l app=registry -o jsonpath='{.items[0].metadata.name}')
kubectl wait -n container-registry --for=condition=ready pod/$REGISTRY_POD
```
* Build an image with the test charts and deploy it:
```
HELM_IMAGE=$REGISTRY/shipper-helm:latest make helm
sed s=\<HELM_IMAGE\>=$REGISTRY/shipper-helm:latest= ci/helm.yaml | \
kubectl apply -f -
```
* replace `$REGISTRY` with the proper image registry. You can use `localhost:32000` if you're
running in you microk8s, `MICROK8S-IP:MICROK8S-PORT` if you're running shipper locally,
or use a public registry like docker-registry.
* Build an image with shipper and deploy it (again, replace `$REGISTRY`):
```
managementClusters:
- name: microk8s
applicationClusters:
- name: microk8s
region: local
SHIPPER_IMAGE=$REGISTRY/shipper:latest make shipper
sed s=\<IMAGE\>=$REGISTRY/shipper:latest= kubernetes/shipper.deployment.yaml | \
kubectl create -f -
```
and then `shipperctl admin clusters apply -f clusters.yaml`
* In the background or a different shell run shipper locally `go run cmd/shipper/main.go --logtostderr --kubeconfig ~/.kube/config -v 4 -disable clustersecret`
Leave this running

Once you have a working cluster, you can run the e2e tests like so:
Once you have a working cluster (and shipper pod has a 'ready' condition), you can run the e2e tests like so:

```
go test ./test/e2e -kubeconfig ~/.kube/config -e2e -appcluster microk8s -v
TESTCHARTS=http://$(kubectl get pod -l app=helm -o jsonpath='{.items[0].status.podIP}'):8879
go test ./test/e2e --test.v --e2e --kubeconfig ~/.kube/config --testcharts $TESTCHARTS --progresstimeout=2m --appcluster microk8s
```

Alternatively, if you'd like to use the e2e tests as part of your development

0 comments on commit 7b1ff3c

Please sign in to comment.
You can’t perform that action at this time.