From ffe5dd91c5b92c1dfcf8e262ccfd929e4810b3d7 Mon Sep 17 00:00:00 2001 From: Marshall Jones Date: Wed, 21 Aug 2019 15:15:01 -0700 Subject: [PATCH] Add an example and fix path to downloaded proto file --- Dockerfile.loadtester | 2 +- docs/gitbook/how-it-works.md | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Dockerfile.loadtester b/Dockerfile.loadtester index 2fd6031b..c50d6719 100644 --- a/Dockerfile.loadtester +++ b/Dockerfile.loadtester @@ -16,7 +16,7 @@ rm -rf linux-amd64 RUN curl -sSL "https://github.com/bojand/ghz/releases/download/v0.39.0/ghz_0.39.0_Linux_x86_64.tar.gz" | tar xz -C /tmp && \ mv /tmp/ghz /usr/local/bin && chmod +x /usr/local/bin/ghz && rm -rf /tmp/ghz-web -ADD https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto /tmp/ghz/health.proto +ADD https://raw.githubusercontent.com/grpc/grpc-proto/master/grpc/health/v1/health.proto /tmp/ghz/health.proto RUN ls /tmp diff --git a/docs/gitbook/how-it-works.md b/docs/gitbook/how-it-works.md index 34a0806d..d2c05e1d 100644 --- a/docs/gitbook/how-it-works.md +++ b/docs/gitbook/how-it-works.md @@ -798,6 +798,18 @@ webhooks: cmd: "ghz -z 1m -q 10 -c 2 --insecure podinfo.test:9898" ``` +`ghz` uses reflection to identify which gRPC method to call. If you do not wish to enable reflection for your gRPC service you can implement a standardized health check from the [grpc-proto](https://github.com/grpc/grpc-proto) library. To use this [health check schema](https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto) without reflection you can pass a parameter to `ghz` like this + +```yaml +webhooks: + - name: grpc-load-test-no-reflection + url: http://flagger-loadtester.test/ + timeout: 5s + metadata: + type: cmd + cmd: "ghz --insecure --proto=/tmp/ghz/health.proto --call=grpc.health.v1.Health/Check podinfo.test:9898" +``` + The load tester can run arbitrary commands as long as the binary is present in the container image. For example if you you want to replace `hey` with another CLI, you can create your own Docker image: