Gateway and HTTPRoute resources. Ingress keeps working as before and traefik stays the default IngressClass, so you can move one application at a time.
The option is offered on every Ankra Managed provider: Hetzner, OVHcloud, UpCloud, DigitalOcean, Scaleway, AWS EC2, Ankra Cloud, Proxmox VE and HPE Morpheus. You choose it when you create the cluster.
The Gateway API needs the networking stack, because the stack’s Traefik is what serves it. The API refuses
gateway_api: true together with include_networking: false with HTTP 400, and the CLI refuses --gateway-api together with --include-networking=false and exits with code 2.Turn it on when you create the cluster
- Dashboard
- CLI
- API
In the create wizard of the new Ankra portal (
/next on your portal’s address), open Advanced configuration, keep Install the networking stack ticked, and tick Add the Kubernetes Gateway API. The checkbox is shown only while the networking stack is ticked. Review then lists Gateway API under Included.What it installs
The networking stack already runs Traefik, cert-manager and theletsencrypt-prod ClusterIssuer. The option adds one add-on and changes Traefik, cert-manager and external-dns:
The shared Gateway
traefik-gateway has one listener:
Port
8000 is the container port of Traefik’s web entry point. Traefik binds a Gateway listener to the entry point with the same container port, so a listener port is an entry point port: 8000 for web and 8443 for websecure. Clients reach the listener the same way they reach your Ingress hosts over HTTP, on port 80 of Traefik’s Service.
The shared Gateway has no HTTPS listener, because HTTPS needs a certificate for each hostname. For HTTPS, create your own Gateway, as in Serve HTTPS from your own Gateway.
Route HTTP traffic
Attach an HTTPRoute to the shared Gateway’sweb listener. This one sends app.<cluster-domain> to the my-app Service on port 80:
ankra cluster domain <cluster> prints the cluster’s domain. external-dns publishes a hostname under that domain at the Gateway’s addresses. A hostname on any other domain gets no record from Ankra, and that includes a zone you serve with your own DNS credential: create its record yourself.
Serve HTTPS from your own Gateway
For HTTPS, create a Gateway of classtraefik in your application’s namespace, with a listener on Traefik’s websecure entry point:
port: 8443, which Traefik’s Service serves on port 443protocol: HTTPSand ahostnametls.certificateRefsnaming the Secret the certificate goes into- the annotation
cert-manager.io/cluster-issuer: letsencrypt-prodon the Gateway
sectionName:
allowedRoutes.
The letsencrypt-prod ClusterIssuer answers the HTTP-01 challenge from Let’s Encrypt through the same Traefik, so the hostname has to resolve to the cluster before the certificate can be issued. For a hostname under the cluster’s domain, external-dns publishes the record from the HTTPRoute.
Ankra Cloud clusters in ipv6_only mode
On an Ankra Cloud cluster in theipv6_only network mode, external-dns publishes HTTPRoute hostnames under the cluster’s domain as proxied records by default, as it does for Ingress hostnames. Ankra Cloud’s relay answers IPv4 clients, terminates TLS, and forwards plain HTTP to port 80 of the cluster’s load balancer, which is Traefik’s web entry point.
A proxied HTTPRoute hostname therefore has to attach to a listener on the web entry point, such as the shared Gateway’s web listener. A route attached only to an HTTPS listener of your own Gateway receives none of the relay’s traffic. Give it a direct record instead with this annotation on the HTTPRoute:
Verify
Read the shared Gateway and your routes with the CLI:- The shared Gateway’s status has the condition
Programmedset toTrue, and itsaddressesare the load balancer’s addresses. - Each HTTPRoute’s status lists its parent Gateway with the condition
Acceptedset toTrue.
Troubleshooting
Related
- Cluster domains - the cluster’s own Ankra domain, and what external-dns manages.
- Serving a zone in your own DNS account - DNS for Ingress hosts on your own domains.
- Envoy Gateway and the Gateway API - install another Gateway API implementation from its Helm chart.