Check the class the controller registered, then create a Gateway with one HTTP listener:
sh
kubectl get gatewayclass
kubectl apply -n abyss-1urtact -f - <<EOF
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: market-gateway
spec:
gatewayClassName: traefik
listeners:
- name: web
port: 80
protocol: HTTP
EOF
kubectl get gateway -n abyss-1urtactAttach a route for shop.example: /monsters to market-api:8080, everything else to market-web:80:
sh
kubectl apply -n abyss-1urtact -f - <<EOF
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: shop
spec:
parentRefs:
- name: market-gateway
hostnames: ["shop.example"]
rules:
- matches:
- path:
type: PathPrefix
value: /monsters
backendRefs:
- name: market-api
port: 8080
- backendRefs:
- name: market-web
port: 80
EOF
curl -s -H "Host: shop.example" http://10.0.0.10/
curl -s -H "Host: shop.example" http://10.0.0.10/monsters
curl -s -H "Host: other.example" http://10.0.0.10/