WireGuard Mesh on Kubernetes with Cilium CNI

Networking
Date:November 19, 2026
Topic:
WireGuard Mesh on Kubernetes with Cilium CNI
⏱ 3 min read

Kubernetes clusters are flat by default. Every pod talks to every other pod across nodes with zero encryption. That works fine inside a trusted VPC, but it collapses the moment traffic crosses cloud boundaries, on-prem edges, or untrusted networks. WireGuard solves the encryption piece. Cilium solves the identity and policy piece. Together they give you a zero-trust mesh without the weight of a full service mesh sidecar.

Why WireGuard in the Dataplane

WireGuard runs in kernel space, uses modern AEAD ciphers (ChaCha20-Poly1305), and adds roughly 60 bytes of overhead per packet. Compared to IPsec or userspace TLS proxies, latency stays sub-millisecond and CPU stays low. Cilium 1.13+ wires this directly into its eBPF datapath: when you enable encryption: wireguard, Cilium generates keys per node, distributes them via the Kubernetes API, and programs the WireGuard interface (cilium_wg0) into the host network namespace. No daemon set, no extra container, no manual key rotation.

yaml
apiVersion: cilium.io/v2alpha1
kind: CiliumConfig
metadata:
  name: default
spec:
  encryption:
    enabled: true
    type: wireguard
  wireguard:
    persistentKeepalive: 25
    port: 51820
💡
TipSet persistentKeepalive to 25 seconds if nodes sit behind NAT or cloud load balancers that drop idle UDP flows.

Identity-Driven Policy, Not IP CIDRs

Traditional VPNs authorize by source IP. Cilium authorizes by Kubernetes identity labels. A CiliumNetworkPolicy can say "allow traffic from pods labeled app=payments to app=ledger on port 443" and the encryption decision follows the identity, not the node IP. If a pod reschedules to a new node, the policy moves with it. The WireGuard tunnel is always node-to-node, but the authorization is pod-to-pod.

yaml
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
  name: payments-to-ledger
spec:
  endpointSelector:
    matchLabels:
      app: ledger
  ingress:
  - fromEndpoints:
    - matchLabels:
        app: payments
    toPorts:
    - ports:
      - port: "443"
        protocol: TCP

Cross-Cluster and Hybrid Mesh

Cilium Cluster Mesh stitches multiple Kubernetes clusters into a single logical network. Enable WireGuard on each cluster, peer the Cluster Mesh via cilium clustermesh enable, and you get encrypted connectivity across clouds, regions, or on-prem data centers. The same identity model applies: a pod in AWS EKS talks to a pod in a bare-metal OpenShift cluster with zero config change.

"

We replaced a 12-node IPsec mesh with Cilium WireGuard and cut tail latency by 40% while dropping the ops runbook from 30 pages to 3.

— Platform Lead, Fintech Unicorn

Operational Gotchas

IssueMitigation
UDP 51820 blocked by SG/firewallOpen inbound/outbound on all node SGs
MTU mismatch causes fragmentationSet <code>mtu: 1420</code> in CiliumConfig or ensure 1500 end-to-end
Key rotation stalls on large clustersUpgrade to Cilium 1.15+ for parallel key distribution
IPv6 pods need dual-stack WireGuardEnable <code>enable-ipv6: true</code> and <code>wireguard.ipv6</code>
⚠️
WarningWireGuard encryption only covers pod-to-pod traffic. Host-network pods, NodePort services, and external load balancers still need TLS or IPsec termination at the edge.

Observability Without Sidecars

Because encryption lives in the eBPF datapath, Hubble sees cleartext headers for flow logs, metrics, and service maps. You get golden signals (latency, error rate, throughput) per identity without injecting a proxy. Enable Hubble Relay and Grafana dashboards to alert on encryption failures, key rotation lag, or policy drops.

bash
cilium hubble enable --ui
type: wireguard
cilium status --wait

✦

Ship It Checklist

1. Upgrade kernel to 5.10+ on all nodes (WireGuard backport exists for 5.4 but avoid). 2. Apply the CiliumConfig above via Helm values or cilium config set. 3. Verify cilium status shows Encryption: WireGuard and Key Rotation: OK. 4. Run cilium encrypt status to confirm peer keys. 5. Deploy a test workload across zones and capture a pcap on cilium_wg0 — you should see only UDP 51820 with encrypted payloads. 6. Add Cluster Mesh if you run multi-cluster. 7. Document the UDP port and MTU in your runbook.

ℹ️
NoteNext step: pair this with Cilium L7 policies for HTTP/gRPC authorization and you have a full zero-trust stack without a single sidecar.
Share𝕏 Twitterin LinkedInin Whatsapp