Skip to content

Simple routing


Deploy a workload

kubectl apply -f apps/httpbin.yaml

Deploy an HTTPRoute to httpbin

---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: httpbin
  annotations:
    external-dns.alpha.kubernetes.io/ttl: "60"
spec:
  hostnames:
  - httpbin.esuez.org
  parentRefs:
  - name: eg
  rules:
  - backendRefs:
    - name: httpbin
      port: 8000
kubectl apply -f simple-route/httpbin-route.yaml

✅ Verify

After the DNS entry is created for the hostname specified in the HTTPRoute, try to access the app:

curl http://httpbin.esuez.org/json
curl http://httpbin.esuez.org/json --resolve httpbin.esuez.org:80:$GATEWAY_IP