Skip to main content
The networking stack on a cluster Ankra builds runs Traefik as its Ingress controller. With the Gateway API option, the same Traefik also serves the Kubernetes Gateway API: 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

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 the letsencrypt-prod ClusterIssuer. The option adds one add-on and changes Traefik, cert-manager and external-dns:
Uninstalling the gateway-api-crds add-on keeps the CRDs. Every object the chart installs carries helm.sh/resource-policy: keep, because deleting a CRD deletes every resource of that kind. Your Gateways and routes stay in place with the CRDs. Delete the CRDs by hand only if you mean to delete those too.

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’s web listener. This one sends app.<cluster-domain> to the my-app Service on port 80:
Add it to a Stack as a manifest, next to the application it routes to. 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 class traefik in your application’s namespace, with a listener on Traefik’s websecure entry point:
  • port: 8443, which Traefik’s Service serves on port 443
  • protocol: HTTPS and a hostname
  • tls.certificateRefs naming the Secret the certificate goes into
  • the annotation cert-manager.io/cluster-issuer: letsencrypt-prod on the Gateway
cert-manager’s Gateway shim reads the annotation and creates a Certificate for the listener’s hostname into that Secret. Attach the HTTPRoute to the listener by name with sectionName:
Keep the HTTPRoute in the Gateway’s namespace: a listener admits routes only from its own namespace unless it sets 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 the ipv6_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:
A direct record is an IPv6 address only, so IPv4 clients cannot reach that hostname.

Verify

Read the shared Gateway and your routes with the CLI:
  • The shared Gateway’s status has the condition Programmed set to True, and its addresses are the load balancer’s addresses.
  • Each HTTPRoute’s status lists its parent Gateway with the condition Accepted set to True.

Troubleshooting