Sub topic 14
Planning a parallel-run migration
This chapter assumes you can read Ingress, Gateway, and HTTPRoute manifests and use kubectl and curl. It covers how to plan the migration. Later chapters cover verification and the cutover itself.
Why run both stacks
A parallel run keeps the Ingress NGINX controller serving production while a Gateway API implementation serves a copy of the same routes. The two stacks use separate load balancers and separate external addresses. Both send traffic to the same Services and Pods. Nothing about the backends changes, so you can move traffic in either direction by changing only DNS.
Build the plan in stages
- Inventory. List every Ingress, its annotations, its TLS Secrets, and its hostnames. Mark annotations with no portable equivalent. They decide how much manual work remains.
- Install the new data plane. Deploy your chosen implementation and its GatewayClass. Leave the old controller untouched.
- Create the Gateway and routes. Use the namespaces and hostnames you already have. Do not delete or edit any Ingress.
- Test on the new address only. Send requests to the Gateway's address while real users still use the old one.
- Shift traffic gradually. Lower the DNS TTL first, then move traffic in steps, as the cutover chapter describes.
- Keep the old stack until you are sure. Remove it only after a quiet observation period.
Test before any DNS change
Look up the Gateway's address, then force curl to resolve your hostname to it. The --resolve flag skips DNS, so production traffic is unaffected.
GW_IP=$(kubectl get gateway shared-gateway -n gateway-system \
-o jsonpath='{.status.addresses[0].value}')
curl -sv --resolve app.example.com:443:"$GW_IP" \
https://app.example.com/api/healthRun the same request against the old controller's address and compare status codes, headers, and redirect behavior.
Things that go wrong in a parallel run
- Duplicate certificate handling. If cert-manager issues certificates from Ingress annotations, check that it does not create competing Secrets for the same name.
- Doubled load on backends. Both proxies hold connections to your Pods. This matters most during gradual shifts, when each stack carries part of the traffic.
- State that lives in the proxy. Rate limits, sticky sessions, and connection counters belong to each proxy separately. Traffic moving between stacks resets them.
- Cached DNS. Some clients ignore TTLs. Expect stragglers on the old address for a while after a change, so the old stack must keep working.
- Shared ownership confusion. Record which team owns the Gateway and which owns the routes before you start, because the role split differs from Ingress.
Define success and rollback up front
Write down, before you begin, which signals count as healthy (for example, error rate and p95 latency compared with the old stack) and who decides to roll back. Rollback is a DNS change back to the old address, which works only if the old Ingress and controller are still running.
Exercise
Why test with curl --resolve instead of editing DNS first, and what must stay in place so rollback is possible?
Show answer
--resolve sends requests to the Gateway's address without affecting real users, so you can find problems before any traffic moves. For rollback, the old Ingress resources and the Ingress NGINX controller must keep running, so you can point DNS back to the old load balancer.