From 64c1a6b4f7aadee04554d07d365112077ff417fa Mon Sep 17 00:00:00 2001 From: Rob Scott Date: Fri, 1 Oct 2021 14:22:10 -0700 Subject: [PATCH] Updating HTTPRoute docs for v1alpha2 --- examples/v1alpha2/http-filter.yaml | 18 ++++++++++++++++++ examples/v1alpha2/traffic-split-1.yaml | 21 --------------------- site-src/v1alpha2/api-types/httproute.md | 14 +++++++------- 3 files changed, 25 insertions(+), 28 deletions(-) create mode 100644 examples/v1alpha2/http-filter.yaml delete mode 100644 examples/v1alpha2/traffic-split-1.yaml diff --git a/examples/v1alpha2/http-filter.yaml b/examples/v1alpha2/http-filter.yaml new file mode 100644 index 0000000000..541db904d0 --- /dev/null +++ b/examples/v1alpha2/http-filter.yaml @@ -0,0 +1,18 @@ +apiVersion: gateway.networking.k8s.io/v1alpha2 +kind: HTTPRoute +metadata: + name: http-filter-1 +spec: + hostnames: + - my.filter.com + rules: + - filters: + - type: RequestHeaderModifier + requestHeaderModifier: + add: + - name: my-header + value: foo + backendRefs: + - name: my-filter-svc1 + weight: 1 + port: 80 diff --git a/examples/v1alpha2/traffic-split-1.yaml b/examples/v1alpha2/traffic-split-1.yaml deleted file mode 100644 index f44e2f4eb9..0000000000 --- a/examples/v1alpha2/traffic-split-1.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: foo-route -spec: - parentRefs: - - name: prod-web-gw - hostnames: - - foo.example.com - rules: - - backendRefs: - - name: foo-v1 - port: 8080 - - matches: - - headers: - - type: Exact - name: traffic - value: test - backendRefs: - - name: foo-v2 - port: 8080 diff --git a/site-src/v1alpha2/api-types/httproute.md b/site-src/v1alpha2/api-types/httproute.md index 431d582b19..94edd896b5 100644 --- a/site-src/v1alpha2/api-types/httproute.md +++ b/site-src/v1alpha2/api-types/httproute.md @@ -111,7 +111,7 @@ strategies, rate-limiting, and traffic shaping. The following example adds header "my-header: foo" to HTTP requests with Host header "my.filter.com". ```yaml -{% include 'v1alpha1/http-filter.yaml' %} +{% include 'v1alpha2/http-filter.yaml' %} ``` API conformance is defined based on the filter type. The effects of ordering @@ -137,18 +137,18 @@ The following example forwards HTTP requests for prefiex `/bar` to service "my-service1" on port `8080` and HTTP requests for prefex `/some/thing` with header `magic: foo` to service "my-service2" on port `8080`: ```yaml -{% include 'v1alpha1/basic-http.yaml' %} +{% include 'v1alpha2/basic-http.yaml' %} ``` -The following example uses the `weight` field to forward HTTP requests for -prefix `/bar` equally across service "my-trafficsplit-svc1" and service -"my-trafficsplit-svc2", i.e. traffic splitting: +The following example uses the `weight` field to forward 90% of HTTP requests to +`foo.example.com` to the "foo-v1" Service and the other 10% to the "foo-v2" +Service: ```yaml -{% include 'v1alpha1/http-trafficsplit.yaml' %} +{% include 'v1alpha2/traffic-splitting/traffic-split-2.yaml' %} ``` Reference the [backendRef][backendRef] API documentation for additional details -of `weight` and other fields. +on `weight` and other fields. ## Status