All notes

Kubernetes & Networking · November 24, 2026

How to Configure Cilium eBPF with Kubernetes Gateway API: Production Guide [2026]

#Cilium#eBPF#Kubernetes#Gateway API#Ingress Migration#DevOps#SRE

TL;DR // Quick Answer

To run Cilium eBPF with Kubernetes Gateway API in production, install the standard Gateway API CRDs first, deploy Cilium with kubeProxyReplacement=true and gatewayAPI.enabled=true, then replace legacy Ingress annotations with typed Gateway and HTTPRoute manifests enforced directly in the eBPF datapath.

For years, Kubernetes teams relied on ingress-nginx and kube-proxy iptables chains to route external traffic into cluster workloads. At scale—especially in latency-sensitive fintech and multi-tenant SaaS clusters—that legacy stack creates two persistent bottlenecks: O(n) iptables rule evaluation overhead and brittle, vendor-locked Ingress annotations.

Combining Cilium eBPF with the Kubernetes Gateway API solves both problems. Cilium replaces kube-proxy with kernel-level eBPF hash maps while natively implementing the role-oriented Gateway and HTTPRoute controllers.


1. Prerequisites & CRD Installation

Cilium requires the official Kubernetes Gateway API CRDs to exist in the cluster before the Cilium operator boots with Gateway API enabled.

# Install standard Gateway API v1.2+ CRDs
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.1/standard-install.yaml

# Optional: add TLSRoute if you need SNI passthrough for databases or mTLS services
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.2.1/config/crd/experimental/gateway.networking.k8s.io_tlsroutes.yaml

Verify the CRDs are established:

kubectl get crd | grep gateway.networking.k8s.io

2. Production Cilium Helm Configuration

Enable kubeProxyReplacement and gatewayAPI in your Helm values. On bare-metal or Proxmox clusters without a cloud LoadBalancer, pair this with Cilium's built-in L2 Announcements or BGP Control Plane.

# cilium-values.yaml
kubeProxyReplacement: true

k8sServiceHost: "10.0.10.10" # Replace with your API server VIP / endpoint
k8sServicePort: 6443

gatewayAPI:
  enabled: true
  enableAlpn: true
  enableAppProtocol: true

envoy:
  enabled: true
  prometheus:
    enabled: true

hubble:
  enabled: true
  relay:
    enabled: true
  metrics:
    enableOpenMetrics: true
    enabled:
      - dns
      - drop
      - tcp
      - flow
      - httpV2:exemplars=true;labelsContext=source_ip,source_namespace,source_workload,destination_ip,destination_namespace,destination_workload

Apply the release and restart the operator if upgrading an existing cluster:

helm upgrade --install cilium cilium/cilium \
  --namespace kube-system \
  --values cilium-values.yaml

kubectl -n kube-system rollout restart deployment/cilium-operator
kubectl -n kube-system rollout restart ds/cilium

Confirm Cilium registered the cilium GatewayClass:

kubectl get gatewayclass cilium

3. Defining the Cluster Gateway (Platform Team)

Unlike legacy Ingress, the Gateway API separates infrastructure listeners and TLS certificates (Gateway) from application routing rules (HTTPRoute).

apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: prod-edge-gateway
  namespace: platform-edge
spec:
  gatewayClassName: cilium
  listeners:
    - name: http-redirect
      protocol: HTTP
      port: 80
      allowedRoutes:
        namespaces:
          from: Same
    - name: https-edge
      protocol: HTTPS
      port: 443
      hostname: "*.example.com"
      tls:
        mode: Terminate
        certificateRefs:
          - kind: Secret
            name: wildcard-example-tls
      allowedRoutes:
        namespaces:
          from: Selector
          selector:
            matchLabels:
              edge-access: "enabled"

4. Application Routing & Canary Splits (App Teams)

Developers attach HTTPRoute resources to the shared Gateway without touching TLS keys or load-balancer annotations. Weighted traffic splitting for canary releases is native to the spec:

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: payments-api-route
  namespace: payments
spec:
  parentRefs:
    - name: prod-edge-gateway
      namespace: platform-edge
      sectionName: https-edge
  hostnames:
    - "api.example.com"
  rules:
    - matches:
        - path:
            type: PathPrefix
            value: /v2/payments
      backendRefs:
        - name: payments-api-stable
          port: 8080
          weight: 90
        - name: payments-api-canary
          port: 8080
          weight: 10
      timeouts:
        request: "10s"
        backendRequest: "5s"

5. Production Validation Checklist

Before cutting over DNS from legacy Ingress NGINX to Cilium Gateway API:

  1. Verify L4/L7 eBPF status: Run cilium status and confirm KubeProxyReplacement: True and Envoy daemonset healthy.
  2. Test HTTP-to-HTTPS redirect: Attach a dedicated HTTPRoute with a RequestRedirect filter on the port 80 listener.
  3. Validate Hubble telemetry: Ensure Prometheus is scraping hubble_http_requests_total and envoy_http_downstream_rq_xx for p95/p99 latency visibility.
  4. Enforce CiliumNetworkPolicy: Lock down backend pods so they only accept traffic from the Envoy/Gateway identity rather than arbitrary cluster namespaces.

If your team is planning a zero-downtime migration off ingress-nginx or hardening Kubernetes networking for regulated workloads, see our Infrastructure, DevOps & SRE consulting services or review our multi-service production infrastructure case study.

FAQ // Key Questions

Frequently Asked Questions

Do I need kube-proxy replacement enabled to use Cilium Gateway API?+

Yes. Cilium Gateway API requires kubeProxyReplacement=true so Cilium can handle North-South load balancing, NodePort/LoadBalancer service routing, and socket-level redirection directly in eBPF.

Which Gateway API CRDs must be installed before enabling Cilium Gateway API?+

Install the official Kubernetes Gateway API CRDs (GatewayClass, Gateway, HTTPRoute, ReferenceGrant, and TLSRoute/GRPCRoute if needed) before installing or upgrading the Cilium Helm release, or the Cilium operator will fail to register the Gateway controller.

How does Cilium Gateway API compare to Ingress NGINX in latency and maintainability?+

Cilium Gateway API eliminates fragile vendor-specific Ingress annotations, separates cluster-operator Gateway ownership from developer HTTPRoute ownership, and avoids iptables traversal overhead by routing traffic through eBPF maps.

Share this note