forked from kubernetes-sigs/gateway-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttproute-header-matching.yaml
57 lines (57 loc) · 1.16 KB
/
httproute-header-matching.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: header-matching
namespace: gateway-conformance-infra
spec:
parentRefs:
- name: same-namespace
rules:
# Matches "version: one"
- matches:
- headers:
- name: version
value: one
backendRefs:
- name: infra-backend-v1
port: 8080
# Matches "version: two"
- matches:
- headers:
- name: version
value: two
backendRefs:
- name: infra-backend-v2
port: 8080
# Matches "version: two" AND "color: orange"
- matches:
- headers:
- name: version
value: two
- name: color
value: orange
backendRefs:
- name: infra-backend-v1
port: 8080
# Matches "color: blue" OR "color: green"
- matches:
- headers:
- name: color
value: blue
- headers:
- name: color
value: green
backendRefs:
- name: infra-backend-v1
port: 8080
# Matches "color: red" OR "color: yellow"
- matches:
- headers:
- name: color
value: red
- headers:
- name: color
value: yellow
backendRefs:
- name: infra-backend-v2
port: 8080