Fixing packet drops during Cilium IPsec key rotation
Intro Cilium provides node-to-node encryption using either IPsec or WireGuard, with some tradeoffs in network performance. While this feature seems quite stable on a small cluster with 4 or 5 nodes, I had an issue running it on a production Kubernetes cluster with thousands of worker nodes due to a race condition between XFRM and cilium-agents. This post covers what the problem was, why Cilium node-to-node encryption was causing such an issue, and how I patched upstream Cilium (cilium/cilium#44701) to mitigate it. The fix is in Cilium 1.19.4 and later, and in 1.20.0 and later. ...