Skip to content

Commit

Permalink
Merge pull request #344 from weaveworks/gloo-refactoring
Browse files Browse the repository at this point in the history
Gloo integration refactoring
  • Loading branch information
stefanprodan authored Oct 22, 2019
2 parents f372523 + dfaa039 commit ee05108
Show file tree
Hide file tree
Showing 38 changed files with 1,322 additions and 1,075 deletions.
15 changes: 0 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,6 @@ jobs:
- run: test/e2e-smi-istio.sh
- run: test/e2e-tests.sh canary

e2e-supergloo-testing:
machine: true
steps:
- checkout
- attach_workspace:
at: /tmp/bin
- run: test/container-build.sh
- run: test/e2e-kind.sh 0.2.1
- run: test/e2e-supergloo.sh
- run: test/e2e-tests.sh canary

e2e-gloo-testing:
machine: true
steps:
Expand Down Expand Up @@ -203,9 +192,6 @@ workflows:
- e2e-kubernetes-testing:
requires:
- build-binary
# - e2e-supergloo-testing:
# requires:
# - build-binary
- e2e-gloo-testing:
requires:
- build-binary
Expand All @@ -220,7 +206,6 @@ workflows:
- build-binary
- e2e-istio-testing
- e2e-kubernetes-testing
#- e2e-supergloo-testing
- e2e-gloo-testing
- e2e-nginx-testing
- e2e-linkerd-testing
Expand Down
18 changes: 17 additions & 1 deletion artifacts/gloo/canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: podinfo
namespace: test
spec:
provider: gloo
targetRef:
apiVersion: apps/v1
kind: Deployment
Expand All @@ -28,9 +29,24 @@ spec:
threshold: 500
interval: 30s
webhooks:
- name: acceptance-test
type: pre-rollout
url: http://flagger-loadtester.test/
timeout: 10s
metadata:
type: bash
cmd: "curl -sd 'test' http://podinfo-canary:9898/token | grep token"
- name: gloo-acceptance-test
type: pre-rollout
url: http://flagger-loadtester.test/
timeout: 10s
metadata:
type: bash
cmd: "curl -sd 'test' -H 'Host: app.example.com' http://gateway-proxy-v2.gloo-system/token | grep token"
- name: load-test
url: http://flagger-loadtester.test/
timeout: 5s
metadata:
type: cmd
cmd: "hey -z 1m -q 10 -c 2 http://gloo.example.com/"
cmd: "hey -z 2m -q 5 -c 2 -host app.example.com http://gateway-proxy-v2.gloo-system"
logCmdOutput: "true"
67 changes: 0 additions & 67 deletions artifacts/gloo/deployment.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions artifacts/gloo/hpa.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions artifacts/gloo/virtual-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ spec:
virtualHost:
domains:
- '*'
name: podinfo.default
name: podinfo
routes:
- matcher:
prefix: /
routeAction:
upstreamGroup:
name: podinfo
namespace: gloo
namespace: test
23 changes: 14 additions & 9 deletions docs/gitbook/usage/gloo-progressive-delivery.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,13 @@ kubectl create ns test
Create a deployment and a horizontal pod autoscaler:

```bash
kubectl apply -f ${REPO}/artifacts/gloo/deployment.yaml
kubectl apply -f ${REPO}/artifacts/gloo/hpa.yaml
kubectl -n test apply -k github.com/weaveworks/flagger//kustomize/podinfo
```

Deploy the load testing service to generate traffic during the canary analysis:

```bash
helm upgrade -i flagger-loadtester flagger/loadtester \
--namespace=test
kubectl -n test apply -k github.com/weaveworks/flagger//kustomize/tester
```

Create an virtual service definition that references an upstream group that will be generated by Flagger
Expand Down Expand Up @@ -145,14 +143,21 @@ spec:
# milliseconds
threshold: 500
interval: 30s
# load testing (optional)
# testing (optinal)
webhooks:
- name: acceptance-test
type: pre-rollout
url: http://flagger-loadtester.test/
timeout: 10s
metadata:
type: bash
cmd: "curl -sd 'test' http://podinfo-canary:9898/token | grep token"
- name: load-test
url: http://flagger-loadtester.test/
timeout: 5s
metadata:
type: cmd
cmd: "hey -z 1m -q 10 -c 2 http://app.example.com/"
cmd: "hey -z 2m -q 5 -c 2 -host app.example.com http://gateway-proxy-v2.gloo-system"
```
Save the above resource as podinfo-canary.yaml and then apply it:
Expand Down Expand Up @@ -260,13 +265,13 @@ podinfod=stefanprodan/podinfo:3.1.2
Generate HTTP 500 errors:

```bash
watch curl http://app.example.com/status/500
watch curl -H 'Host: app.example.com' http://gateway-proxy-v2.gloo-system/status/500
```

Generate high latency:

```bash
watch curl http://app.example.com/delay/2
watch curl -H 'Host: app.example.com' http://gateway-proxy-v2.gloo-system/delay/2
```

When the number of failed checks reaches the canary analysis threshold, the traffic is routed back to the primary,
Expand Down Expand Up @@ -343,7 +348,7 @@ podinfod=stefanprodan/podinfo:3.1.3
Generate 404s:

```bash
watch curl http://app.example.com/status/400
watch curl -H 'Host: app.example.com' http://gateway-proxy-v2.gloo-system/status/400
```

Watch Flagger logs:
Expand Down
42 changes: 13 additions & 29 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,37 @@ require (
cloud.google.com/go v0.37.4 // indirect
github.com/Masterminds/semver v1.4.2
github.com/beorn7/perks v1.0.0 // indirect
github.com/bxcodec/faker v2.0.1+incompatible // indirect
github.com/envoyproxy/go-control-plane v0.8.0 // indirect
github.com/gogo/googleapis v1.2.0 // indirect
github.com/gogo/protobuf v1.2.1
github.com/gogo/protobuf v1.2.1 // indirect
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
github.com/golang/protobuf v1.3.1 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/google/go-cmp v0.3.0
github.com/hashicorp/consul v1.4.4 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/hashicorp/go-retryablehttp v0.5.3 // indirect
github.com/hashicorp/go-rootcerts v1.0.0 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/serf v0.8.3 // indirect
github.com/hashicorp/vault v1.1.0 // indirect
github.com/googleapis/gnostic v0.2.0 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/k0kubun/pp v3.0.1+incompatible // indirect
github.com/linkerd/linkerd2 v0.0.0-20190221030352-5e47cb150a33 // indirect
github.com/lyft/protoc-gen-validate v0.0.14 // indirect
github.com/mattn/go-colorable v0.1.1 // indirect
github.com/mattn/go-isatty v0.0.7 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/mitchellh/hashstructure v1.0.0
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect
github.com/prometheus/common v0.3.0 // indirect
github.com/prometheus/procfs v0.0.0-20190416084830-8368d24ba045 // indirect
github.com/radovskyb/watcher v1.0.6 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/solo-io/gloo v0.13.17
github.com/solo-io/go-utils v0.7.11 // indirect
github.com/solo-io/solo-kit v0.6.3
github.com/solo-io/supergloo v0.3.11
go.opencensus.io v0.20.2 // indirect
go.uber.org/atomic v1.3.2 // indirect
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.9.1
golang.org/x/crypto v0.0.0-20190418161225-b43e412143f9 // indirect
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c // indirect
golang.org/x/sys v0.0.0-20190508220229-2d0786266e9c // indirect
golang.org/x/text v0.3.2 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/h2non/gock.v1 v1.0.14
gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/api v0.0.0-20190620073856-dcce3486da33
k8s.io/apiextensions-apiserver v0.0.0-20190315093550-53c4693659ed // indirect
k8s.io/apimachinery v0.0.0-20190620073744-d16981aedf33
k8s.io/client-go v11.0.0+incompatible
k8s.io/code-generator v0.0.0-20190620073620-d55040311883
k8s.io/kube-openapi v0.0.0-20190418160015-6b3d3b2d5666 // indirect
k8s.io/utils v0.0.0-20190308190857-21c4ce38f2a7 // indirect
)

replace (
Expand Down
Loading

0 comments on commit ee05108

Please sign in to comment.