diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml index e774608cc9ac..90367618a1e1 100644 --- a/.github/workflows/benchmark.yaml +++ b/.github/workflows/benchmark.yaml @@ -11,35 +11,45 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - - name: Setup Kubernetes - uses: medyagh/setup-minikube@master - - - name: Install Envoy Gateway Pods via Kubernetes Yaml - run: kubectl apply -f https://github.com/envoyproxy/gateway/releases/download/latest/install.yaml - - name: Wait for Envoy Gateway to become available - run: kubectl wait --timeout=5m -n envoy-gateway-system deployment/envoy-gateway --for=condition=Available - - - name: Install the GatewayClass, Gateway, HTTPRoute and example app - run: kubectl apply -f https://github.com/envoyproxy/gateway/releases/download/latest/quickstart.yaml -n default + - name: Download Nighthawk Docker images + run: | + docker pull envoyproxy/nighthawk-dev:latest - - name: Wait for example app to become available - run: kubectl wait --timeout=5m -n default deployment/backend --for=condition=Available + - name: Run Benchmark tests + env: + KIND_NODE_TAG: v1.29.0 + IMAGE_PULL_POLICY: IfNotPresent + run: make benchmark - - name: Get the name of the Envoy service created the by the example Gateway - run: | - echo "ENVOY_SERVICE=$(kubectl get svc -n envoy-gateway-system --selector=gateway.envoyproxy.io/owning-gateway-namespace=default,gateway.envoyproxy.io/owning-gateway-name=eg -o jsonpath='{.items[0].metadata.name}')" >> $GITHUB_ENV + # - name: Setup Kubernetes + # uses: medyagh/setup-minikube@master - - name: Echo ENVOY_SERVICE - run: echo ${{ env.ENVOY_SERVICE }} - - - name: Port forward to the Envoy service - run: kubectl -n envoy-gateway-system port-forward service/${ENVOY_SERVICE} 8888:80 & - - - name: Curl the example app through Envoy proxy - run: | - curl --verbose --header "Host: www.example.com" http://localhost:8888/get + # - name: Install Envoy Gateway Pods via Kubernetes Yaml + # run: kubectl apply -f https://github.com/envoyproxy/gateway/releases/download/latest/install.yaml + + # - name: Wait for Envoy Gateway to become available + # run: kubectl wait --timeout=5m -n envoy-gateway-system deployment/envoy-gateway --for=condition=Available + # + # - name: Install the GatewayClass, Gateway, HTTPRoute and example app + # run: kubectl apply -f https://github.com/envoyproxy/gateway/releases/download/latest/quickstart.yaml -n default + # + # - name: Wait for example app to become available + # run: kubectl wait --timeout=5m -n default deployment/backend --for=condition=Available + # + # - name: Get the name of the Envoy service created the by the example Gateway + # run: | + # echo "ENVOY_SERVICE=$(kubectl get svc -n envoy-gateway-system --selector=gateway.envoyproxy.io/owning-gateway-namespace=default,gateway.envoyproxy.io/owning-gateway-name=eg -o jsonpath='{.items[0].metadata.name}')" >> $GITHUB_ENV + + # - name: Echo ENVOY_SERVICE + # run: echo ${{ env.ENVOY_SERVICE }} + # + # - name: Port forward to the Envoy service + # run: kubectl -n envoy-gateway-system port-forward service/${ENVOY_SERVICE} 8888:80 & + # + # - name: Curl the example app through Envoy proxy + # run: | + # curl --verbose --header "Host: www.example.com" http://localhost:8888/get #- name: Apply Gateway Configurations # diff --git a/test/benchmark/benchmark-test-server.yaml b/test/benchmark/benchmark-test-server.yaml new file mode 100644 index 000000000000..0f33ea91b1ee --- /dev/null +++ b/test/benchmark/benchmark-test-server.yaml @@ -0,0 +1,7 @@ +### Nighthawk test server configuration + +### Nighthawk test server deployment + +### Gateway + +### HTTPRoute diff --git a/test/benchmark/test-server.yaml b/test/benchmark/test-server.yaml new file mode 100644 index 000000000000..4ff0807de509 --- /dev/null +++ b/test/benchmark/test-server.yaml @@ -0,0 +1,47 @@ +static_resources: + listeners: + # define an origin server on :10000 that always returns "lorem ipsum..." + - address: + socket_address: + address: 0.0.0.0 + port_value: 10000 + filter_chains: + - filters: + - name: envoy.filters.network.http_connection_manager + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager + generate_request_id: false + codec_type: AUTO + stat_prefix: ingress_http + route_config: + name: local_route + virtual_hosts: + - name: service + domains: + - "*" + http_filters: + - name: dynamic-delay + typed_config: + "@type": type.googleapis.com/nighthawk.server.DynamicDelayConfiguration + static_delay: 0.5s + - name: test-server # before envoy.router because order matters! + typed_config: + "@type": type.googleapis.com/nighthawk.server.ResponseOptions + response_body_size: 10 + v3_response_headers: + - { header: { key: "foo", value: "bar" } } + - { + header: { key: "foo", value: "bar2" }, + append: true, + } + - { header: { key: "x-nh", value: "1" } } + - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router + dynamic_stats: false +admin: + access_log_path: /tmp/envoy.log + address: + socket_address: + address: 0.0.0.0 + port_value: 8081 \ No newline at end of file diff --git a/tools/make/kube.mk b/tools/make/kube.mk index 1384c9340e05..23952d37a589 100644 --- a/tools/make/kube.mk +++ b/tools/make/kube.mk @@ -100,6 +100,9 @@ conformance: create-cluster kube-install-image kube-deploy run-conformance delet .PHONY: experimental-conformance ## Create a kind cluster, deploy EG into it, run Gateway API experimental conformance, and clean up. experimental-conformance: create-cluster kube-install-image kube-deploy run-experimental-conformance delete-cluster ## Create a kind cluster, deploy EG into it, run Gateway API conformance, and clean up. +.PHONY: benchmark +benchmark: create-cluster kube-install-image kube-deploy build-benchmark run-benchmark + .PHONY: e2e e2e: create-cluster kube-install-image kube-deploy install-ratelimit run-e2e delete-cluster @@ -182,6 +185,20 @@ run-experimental-conformance: ## Run Experimental Gateway API conformance. kubectl apply -f test/config/gatewayclass.yaml go test -v -tags experimental ./test/conformance -run TestExperimentalConformance --gateway-class=envoy-gateway --debug=true --organization=envoyproxy --project=envoy-gateway --url=https://github.com/envoyproxy/gateway --version=latest --report-output="$(CONFORMANCE_REPORT_PATH)" --contact=https://github.com/envoyproxy/gateway/blob/main/GOVERNANCE.md +.PHONY: build-benchmark +build-benchmark ## Build Benchmark Framework + @$(LOG_TARGET) + git clone -b 0.5.0 https://github.com/envoyproxy/nighthawk.git && cd nighthawk + ci/do_ci.sh build + +.PHONY: run-benchmark +run-benchmark: ## Run benchmark tests + @$(LOG_TARGET) + kubectl wait --timeout=$(WAIT_TIMEOUT) -n envoy-gateway-system deployment/envoy-gateway --for=condition=Available + kubectl apply -f test/config/gatewayclass.yaml +# kubectl create configmap test-server-config --from-file=test/benchmark/test-server.yaml --output yaml + kubectl apply -f https://github.com/envoyproxy/gateway/releases/download/v0.6.0/quickstart.yaml -n default + .PHONY: delete-cluster delete-cluster: $(tools/kind) ## Delete kind cluster. @$(LOG_TARGET)