...
1apiVersion: gateway.networking.k8s.io/v1
2kind: Gateway
3metadata:
4 name: httproute-hostname-intersection
5 namespace: gateway-conformance-infra
6spec:
7 gatewayClassName: "{GATEWAY_CLASS_NAME}"
8 listeners:
9 - name: listener-1
10 port: 80
11 protocol: HTTP
12 allowedRoutes:
13 namespaces:
14 from: Same
15 hostname: very.specific.com
16 - name: listener-2
17 port: 80
18 protocol: HTTP
19 allowedRoutes:
20 namespaces:
21 from: Same
22 hostname: "*.wildcard.io"
23 - name: listener-3
24 port: 80
25 protocol: HTTP
26 allowedRoutes:
27 namespaces:
28 from: Same
29 hostname: "*.anotherwildcard.io"
30---
31apiVersion: gateway.networking.k8s.io/v1
32kind: HTTPRoute
33metadata:
34 name: specific-host-matches-listener-specific-host
35 namespace: gateway-conformance-infra
36spec:
37 parentRefs:
38 - name: httproute-hostname-intersection
39 namespace: gateway-conformance-infra
40 hostnames:
41 - non.matching.com
42 - "*.nonmatchingwildcard.io"
43 - very.specific.com # matches listener-1's specific host
44 rules:
45 - matches:
46 - path:
47 type: PathPrefix
48 value: /s1
49 backendRefs:
50 - name: infra-backend-v1
51 port: 8080
52---
53apiVersion: gateway.networking.k8s.io/v1
54kind: HTTPRoute
55metadata:
56 name: specific-host-matches-listener-wildcard-host
57 namespace: gateway-conformance-infra
58spec:
59 parentRefs:
60 - name: httproute-hostname-intersection
61 namespace: gateway-conformance-infra
62 hostnames:
63 - non.matching.com
64 - wildcard.io
65 - foo.wildcard.io # matches listener-2's wildcard host
66 - bar.wildcard.io # matches listener-2's wildcard host
67 - foo.bar.wildcard.io # matches listener-2's wildcard host
68 rules:
69 - matches:
70 - path:
71 type: PathPrefix
72 value: /s2
73 backendRefs:
74 - name: infra-backend-v2
75 port: 8080
76---
77apiVersion: gateway.networking.k8s.io/v1
78kind: HTTPRoute
79metadata:
80 name: wildcard-host-matches-listener-specific-host
81 namespace: gateway-conformance-infra
82spec:
83 parentRefs:
84 - name: httproute-hostname-intersection
85 namespace: gateway-conformance-infra
86 hostnames:
87 - non.matching.com
88 - "*.specific.com" # matches listener-1's specific host
89 rules:
90 - matches:
91 - path:
92 type: PathPrefix
93 value: /s3
94 backendRefs:
95 - name: infra-backend-v3
96 port: 8080
97---
98apiVersion: gateway.networking.k8s.io/v1
99kind: HTTPRoute
100metadata:
101 name: wildcard-host-matches-listener-wildcard-host
102 namespace: gateway-conformance-infra
103spec:
104 parentRefs:
105 - name: httproute-hostname-intersection
106 namespace: gateway-conformance-infra
107 hostnames:
108 - "*.anotherwildcard.io" # matches listener-3's wildcard host
109 rules:
110 - matches:
111 - path:
112 type: PathPrefix
113 value: /s4
114 backendRefs:
115 - name: infra-backend-v1
116 port: 8080
117---
118apiVersion: gateway.networking.k8s.io/v1
119kind: HTTPRoute
120metadata:
121 name: no-intersecting-hosts
122 namespace: gateway-conformance-infra
123spec:
124 parentRefs:
125 - name: httproute-hostname-intersection
126 namespace: gateway-conformance-infra
127 hostnames:
128 - specific.but.wrong.com
129 - wildcard.io
130 rules:
131 - matches:
132 - path:
133 type: PathPrefix
134 value: /s5
135 backendRefs:
136 - name: infra-backend-v2
137 port: 8080
View as plain text