...
1apiVersion: gateway.networking.k8s.io/v1
2kind: GatewayClass
3metadata:
4 name: default-match-example
5spec:
6 controllerName: acme.io/gateway-controller
7---
8apiVersion: gateway.networking.k8s.io/v1beta1
9kind: Gateway
10metadata:
11 name: default-match-gw
12spec:
13 gatewayClassName: default-match-example
14 listeners:
15 - name: http
16 protocol: HTTP
17 port: 80
18---
19# This HTTPRoute demonstrates patch match defaulting. If no path match is
20# specified, CRD defaults adds a default PathPrefix match on the path "/". This
21# matches every HTTP request and ensures that route rules always have at
22# least one valid match.
23apiVersion: gateway.networking.k8s.io/v1beta1
24kind: HTTPRoute
25metadata:
26 name: default-match-route
27 labels:
28 app: default-match
29spec:
30 parentRefs:
31 - name: default-match-gw
32 hostnames:
33 - default-match.com
34 rules:
35 - matches:
36 - headers:
37 - type: Exact
38 name: magic
39 value: default-match
40 backendRefs:
41 - group: acme.io
42 kind: CustomBackend
43 name: my-custom-resource
44 port: 8080
45 - matches:
46 - path:
47 type: Exact
48 value: /example/exact
49 backendRefs:
50 - name: my-service-2
51 port: 8080
View as plain text