1. Kubernetes Gateway API in Practice
A Kubernetes Service gives an application a stable address inside a cluster. To expose that application, an ingress proxy needs to know where to listen, which requests to accept, and where to send them. Gateway API represents those decisions as separate Kubernetes resources.
A GatewayClass identifies the controller that implements the API. A Gateway selects a class and defines listeners, including their ports, protocols, and TLS settings. A Route attaches to a listener and specifies how traffic reaches a backend. This lets a platform team manage a shared entry point while application teams maintain their own routes.
In the EKS migration, the platform team created default/eg-nlb. The application team attached an HTTPRoute from the prod namespace to the Gateway’s https listener:
spec: parentRefs: - name: eg-nlb namespace: default sectionName: https hostnames: - dashboard.example.com rules: - backendRefs: - name: dashboard port: 80 The listener’s allowedRoutes controls which namespaces can attach routes. The route’s sectionName selects a specific listener, and the backend port is the Kubernetes Service port.
To verify the attachment, inspect kubectl -n prod get httproute dashboard -o yaml. Under status.parents, find the entry for default/eg-nlb and check that Accepted and ResolvedRefs are both True for the current generation. Then make a request to the hostname. The status conditions verify the controller’s configuration, while the request checks the runtime path.
2. How Envoy Gateway Provisions an AWS NLB
On Amazon EKS, a Kubernetes Service of type LoadBalancer can ask an AWS integration to provision a cloud load balancer. The Service’s loadBalancerClass identifies the controller that should handle it.
With Envoy Gateway, two controllers participate. Envoy Gateway turns Gateway API resources into proxy configuration and creates the Envoy Deployment and Service. AWS Load Balancer Controller reconciles that Service into an NLB and its target groups. The NLB forwards TCP traffic to Envoy, where TLS termination and application routing happen.
For the migration, the new Gateway referenced an EnvoyProxy through spec.infrastructure.parametersRef. This excerpt shows the settings that selected a public NLB with IP targets:
spec: provider: type: Kubernetes kubernetes: envoyService: loadBalancerClass: service.k8s.aws/nlb annotations: service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing IP target mode registers Envoy Pod IPs. The migration configuration used three Envoy replicas and a PodDisruptionBudget with minAvailable: 2. The budget governs voluntary disruptions, and node affinity controls eligible nodes. Check where the Pods actually land to verify Availability Zone coverage. When cross-zone load balancing is disabled, check healthy target availability in each enabled zone. AWS Load Balancer Controller NLB documentation.
Verify the generated Service’s class and external hostname, the Gateway’s Programmed condition, and the AWS target groups’ health. These checks distinguish a provisioning failure from a running load balancer whose targets are unhealthy.
3. Issuing Gateway Certificates with HTTP-01 and DNS-01
A public certificate authority uses ACME challenges to verify control of a domain. In Kubernetes, cert-manager obtains and renews the certificate, then writes it and its private key to a TLS Secret. The Gateway’s HTTPS listener references that Secret.
| Challenge | What the CA checks | When to use it |
|---|---|---|
| HTTP-01 | A challenge response at http://<hostname>/.well-known/acme-challenge/<token> | A specific hostname with publicly reachable port 80 |
| DNS-01 | A public TXT record under _acme-challenge.<domain> | Wildcards or issuance independent of the application’s traffic endpoint |
HTTP-01 through Envoy Gateway. Enable cert-manager’s Gateway API integration and configure its solver to attach to an HTTP listener on port 80. During issuance, cert-manager creates a temporary solver Pod, Service, and HTTPRoute. The hostname’s public DNS needs to lead to the entry point serving that route, and the listener must allow routes from the solver’s namespace. HTTP-01 supports individual hostnames. Use DNS-01 for wildcard certificates. cert-manager HTTP-01 configuration.
# Excerpt from ClusterIssuer.spec.acme.solvers - http01: gatewayHTTPRoute: parentRefs: - name: eg-nlb namespace: default sectionName: http serviceType: ClusterIP While the challenge is pending, use kubectl describe challenge -n <namespace> <name> to find the token and failure reason. Check that the temporary solver route is accepted, then request the full challenge URL from outside the cluster. It should return the expected challenge response. A DNS answer alone does not verify that port 80 and the solver route work.
DNS-01 through Route 53. Give cert-manager permission to manage challenge records in the public hosted zone. In the migration, a ClusterIssuer referenced AWS credentials held in a Kubernetes Secret. A dedicated DNS-01 issuer handled the shared wildcard certificate. Another issuer used a DNS zone selector to choose the Route 53 solver for matching domains and had an HTTP-01 solver for eligible unmatched names. Solver selection determines which challenge to present. A failed DNS-01 challenge does not trigger an HTTP-01 retry. Route 53 solver configuration · ACME solver selection.
# Excerpt from ClusterIssuer.spec.acme.solvers - selector: dnsZones: - example.com dns01: route53: region: eu-west-2 accessKeyIDSecretRef: name: route53-credentials key: access-key-id secretAccessKeySecretRef: name: route53-credentials key: secret-access-key While DNS-01 is pending, query an authoritative nameserver with dig @<authoritative-ns> TXT _acme-challenge.example.com. Compare the TXT answer with the challenge status. cert-manager cleans up its temporary challenge record after validation, so perform this check during issuance.
The practical migration benefit was that DNS-01 let us prepare the certificate before moving application DNS. We used separate SANs for *.example.com and *.eu.api.example.com, since the first wildcard covers dashboard.example.com and the second covers adapter.eu.api.example.com. Once the Certificate reports Ready=True, test the certificate actually served by the new Gateway. For example, curl --connect-to dashboard.example.com:443:<new-nlb-hostname>:443 https://dashboard.example.com/ preserves the hostname used for SNI and certificate validation.
4. Replacing NGINX Rules with HTTPRoute
An HTTP reverse proxy can select a backend based on a request’s hostname, path, method, or headers. It can also modify the request. During a migration, the behavior that matters is what the client sends and what the upstream receives.
In the EKS migration, several NGINX forwarding rules lived in a shared ConfigMap. We moved application routes into their respective component directories. For a dashboard API, clients called /graph-api/health, while the upstream expected /health. An HTTPRoute could express that conversion directly:
rules: - matches: - path: type: PathPrefix value: /graph-api filters: - type: URLRewrite urlRewrite: path: type: ReplacePrefixMatch replacePrefixMatch: / backendRefs: - name: dashboard-api port: 8027 A rewrite changes the request delivered to the upstream. A redirect tells the client to make a new request and is useful for HTTP-to-HTTPS redirects or canonical URLs.
For each migrated route, compare requests through both entry points. Check status codes, redirect locations, the path received by the backend, and externally visible headers. Include representative uploads and sustained WebSocket connections where the application uses them. For WebSockets, test the handshake and leave the connection idle long enough to exercise the load balancer and proxy idle timeouts.
5. Routing gRPC Through Envoy Gateway
gRPC commonly runs over HTTP/2. A gRPC request identifies a service and method, and its result includes a gRPC status. An HTTP response code alone gives an incomplete picture of whether the call succeeded.
A GRPCRoute can match a gRPC service or method and forward it to a Kubernetes Service. A client using OTLP over HTTP instead sends telemetry to HTTP paths such as /v1/traces, which can be routed with HTTPRoute.
The migration exposed both protocols through the shared NLB:
| Public endpoint | Protocol | Gateway route |
|---|---|---|
telemetry.example.com:4317 | OTLP/gRPC over TLS | GRPCRoute |
telemetry.example.com:4318 | OTLP/HTTP over TLS | HTTPRoute |
Each port had its own Gateway listener and route attachment. Envoy terminated TLS and forwarded traffic to the matching collector receiver. The gRPC listener, the backend’s protocol configuration, and the collector receiver all had to agree on how to carry gRPC traffic.
To verify the gRPC path, send a small trace with a real OTLP exporter, check its gRPC result, and look up the trace in the storage backend. This exercises DNS, TLS, route attachment, authentication, and upstream HTTP/2 in one test. A successful TCP connection verifies only that something is listening.
6. Collecting Traces, Logs, and Metrics Through Alloy
Traces follow a request across services. Logs record individual events. Metrics summarize measurements over time. An OpenTelemetry collector can receive all three over OTLP and direct each signal to the appropriate storage backend.
In the migration, Grafana Alloy became the shared ingestion point. Applications sent traces to Alloy for forwarding to Tempo, OTLP logs went to the Loki pipeline, and metrics followed the configured metrics pipeline. Grafana queried the storage backends for investigation and dashboards. For external senders, the collector required authentication, with application credentials supplied through Kubernetes Secrets.
One EU exporter repeatedly reported UnknownIssuer on the gRPC path. The TLS handshake failed before the receiver could evaluate the authentication header. We moved the affected exporters to the authenticated OTLP/HTTP endpoint and confirmed a trace reached Tempo. A protocol switch can work around a difference in client transport or trust configuration. Its success does not establish the precise cause of the original trust failure.
Verify each signal independently. Find a trace by its trace ID, search for a distinctive log with the expected resource labels, and query a metric series after an export interval. A healthy collector endpoint can coexist with a failed downstream exporter or an application that never emits the signal.
7. Migrating Production Traffic from CLB and NGINX to NLB
An ingress migration changes where clients connect and how their requests are routed. DNS controls where new connections go. Existing connections, including WebSockets, remain on the old entry point until they close. That distinction determines when it is safe to retire the old load balancer.
We created eg-nlb alongside the existing entrance and attached the new routes while the old entrance continued serving traffic. Before changing DNS, we checked the new NLB’s target health, Gateway status, TLS certificate, and application behavior. A test like this connects to the new NLB while preserving the production hostname:
curl --connect-to \ "dashboard.example.com:443:${NEW_NLB_HOSTNAME}:443" \ https://dashboard.example.com/graph/login We then moved Route 53 records in batches and kept the previous targets available for rollback. Save each old record before changing it. If using a lower TTL for the cutover, make the change early enough for answers cached under the old TTL to expire. After each batch, verify the public DNS answer and repeat the application tests. If a route fails, restore the previous DNS target while the old entrance can still serve it.
The migration exposed a useful troubleshooting case. One hostname resolved to the new NLB and returned 404. The new Gateway was reachable, but the route had not been attached to the expected listener after listener consolidation. Checking the route’s parent and listener binding resolved the problem.
Retirement came after checking the remaining traffic and dependencies. Helm-managed applications had to stop creating the old Ingress resources, cert-manager renewals had to work through the replacement solvers, and long-lived connections needed time to drain. Once those checks passed, the old controller and its load balancer could be retired through the normal deployment workflow.
