Modernizing Kubernetes Traffic: A Guide to the Gateway API Migration
In my previous posts, we explored how to use MetalLB to bring real LoadBalancer IPs to a local Minikube cluster and how to manage them with standard Ingress. But as Kubernetes matures, the community is moving toward a more expressive, role-oriented standard: The Gateway API
If Ingress is the Legacy Path, then the Gateway API is the modern highway. In this guide, I will walk you through a complete migration demonstrating how to swap out your old Ingress controllers for Envoy Gateway. We won’t just move traffic; we’ll leverage Envoy’s power to implement seamless request mirroring and more robust, path-based routing that was previously hidden behind complex annotations.
Pre-requisite is to have metallb configured in the minikube cluster to follow this guide.
Envoy Gateway Architecture
Step 1: Installing the Envoy Gateway Controller
helm install eg oci://docker.io/envoyproxy/gateway-helm --version v1.1.0 -n envoy-gateway-system --create-namespaceThis command installs Envoy Gateway into your cluster using Helm, pulling the chart directly from Docker Hub’s OCI registry. It creates a dedicated envoy-gateway-system namespace and deploys the Envoy Gateway controller there, which will watch for GatewayClass and Gateway resources across your cluster.
qvamjak% helm list -n envoy-gateway-system
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
eg envoy-gateway-system 1 2026-02-18 07:16:54.071637216 +0530 IST deployed gateway-helm-v1.1.0 v1.1.0 Step 2: Deploy the GatewayClass and Gateway
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: eg
spec:
controllerName: gateway.envoyproxy.io/gatewayclass-controllerqvamjak% kubectl create -f gatewayclass.yaml
gatewayclass.gateway.networking.k8s.io/eg created
qvamjak% kubectl get gatewayclass
NAME CONTROLLER ACCEPTED AGE
eg gateway.envoyproxy.io/gatewayclass-controller True 28sqvamjak% cat gateway.yaml
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: eg
namespace: default
spec:
gatewayClassName: eg
listeners:
- name: http
protocol: HTTP
port: 80
qvamjak% kubectl create -f gateway.yaml
gateway.gateway.networking.k8s.io/eg createdStep-3: Install App Hello Green and Blue Whale services
Pls follow the instructions in my earlier Ingress blog
Step-4: Create a HTTP Route
qvamjak% cat whale-route.yaml
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: whale-route
spec:
parentRefs: [{name: eg}]
hostnames: ["hello.whale.info"]
rules:
- matches: [{path: {type: PathPrefix, value: /green}}]
filters: [{type: URLRewrite, urlRewrite: {path: {type: ReplacePrefixMatch, replacePrefixMatch: /}}}]
backendRefs: [{name: hello-green-whale-svc, port: 80}]
- matches: [{path: {type: PathPrefix, value: /blue}}]
filters: [{type: URLRewrite, urlRewrite: {path: {type: ReplacePrefixMatch, replacePrefixMatch: /}}}]
backendRefs: [{name: hello-blue-whale-svc, port: 80}]The whale-route HTTPRoute attaches itself to the eg Gateway and acts as the traffic cop for anything arriving at hello.whale.info. When a request comes in, Envoy checks the path — if it starts with /green, the /green prefix is silently stripped off and the request is forwarded clean to hello-green-whale-svc .The exact same logic applies for /blue, which routes to hello-blue-whale-svc instead. Rules are evaluated top to bottom, so a request can only match one rule. Any request that doesn't start with /green or /blue — or comes in with a different hostname — simply won't match this route at all and will get a 404 from the gateway.
Get Vamsi Jakkula’s stories in your inbox
Join Medium for free to get updates from this writer.
I have updated the /etc/hosts with the LB IP Address 192.168.49.100
qvamjak% nslookup hello.whale.info
Server: 127.0.0.53
Address: 127.0.0.53#53
Name: hello.whale.info
Address: 192.168.49.100Also we can acheive the same by using the modheader extension in the browser to include the following and we can browse directly using http://192.168.49.100/green/ or http://192.168.49.100/blue
- Header name:
Host - Value:
hello.whale.info











