gateway/gke-gateway-controller/ex2-complex-route.yaml (38 lines of code) (raw):
kind: Gateway
apiVersion: networking.x-k8s.io/v1alpha1
metadata:
name: internal-gw
namespace: default
spec:
class: internal
listeners:
- protocol: HTTP
port: 80
routes:
resource: httproutes
---
apiVersion: networking.x-k8s.io/v1alpha1
kind: HTTPRoute
metadata:
name: my-route
namespace: default
spec:
hosts:
- hostnames:
- foo.com
rules:
- action:
forwardTo:
- targetRef:
name: foo-svc
- hostnames:
- bar.com
rules:
- matches:
- path: /login
headers:
accept: text/html
action:
forwardTo:
- targetRef:
name: bar-svc