2021-04-29 15:18:04 +00:00
|
|
|
---
|
|
|
|
kind: GatewayClass
|
2021-11-09 10:34:06 +00:00
|
|
|
apiVersion: gateway.networking.k8s.io/v1alpha2
|
2021-04-29 15:18:04 +00:00
|
|
|
metadata:
|
|
|
|
name: my-gateway-class
|
|
|
|
spec:
|
2021-11-09 10:34:06 +00:00
|
|
|
controllerName: traefik.io/gateway-controller
|
2021-04-29 15:18:04 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
kind: Gateway
|
2021-11-09 10:34:06 +00:00
|
|
|
apiVersion: gateway.networking.k8s.io/v1alpha2
|
2021-04-29 15:18:04 +00:00
|
|
|
metadata:
|
|
|
|
name: my-gateway
|
|
|
|
namespace: default
|
|
|
|
spec:
|
|
|
|
gatewayClassName: my-gateway-class
|
2021-11-09 10:34:06 +00:00
|
|
|
listeners: # Use GatewayClass defaults for listener definition.
|
|
|
|
- name: http
|
|
|
|
protocol: HTTP
|
2021-04-29 15:18:04 +00:00
|
|
|
port: 80
|
2021-11-09 10:34:06 +00:00
|
|
|
allowedRoutes:
|
2021-04-29 15:18:04 +00:00
|
|
|
namespaces:
|
|
|
|
from: Same
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: HTTPRoute
|
2021-11-09 10:34:06 +00:00
|
|
|
apiVersion: gateway.networking.k8s.io/v1alpha2
|
2021-04-29 15:18:04 +00:00
|
|
|
metadata:
|
|
|
|
name: http-app-1
|
|
|
|
namespace: default
|
|
|
|
spec:
|
2021-11-09 10:34:06 +00:00
|
|
|
parentRefs:
|
|
|
|
- name: my-gateway
|
|
|
|
kind: Gateway
|
|
|
|
group: gateway.networking.k8s.io
|
2021-04-29 15:18:04 +00:00
|
|
|
hostnames:
|
|
|
|
- "foo.com"
|
2021-11-09 10:34:06 +00:00
|
|
|
- "*.foo.com"
|
2021-04-29 15:18:04 +00:00
|
|
|
rules:
|
2021-11-09 10:34:06 +00:00
|
|
|
- backendRefs:
|
|
|
|
- name: whoami
|
2021-04-29 15:18:04 +00:00
|
|
|
port: 80
|
|
|
|
weight: 1
|
2021-11-09 10:34:06 +00:00
|
|
|
kind: Service
|
|
|
|
group: ""
|