Cloud Native & eBPF
Production Chaos Engineering on Kubernetes: eBPF Kernel Probes and Lossless Service Mesh Failover
A real post-mortem of end-to-end self-healing in a large Kubernetes cluster under network jitter and sudden node loss. eBPF sockops and XDP (eXpress Data Path) bypass the host's redundant iptables/conntrack logic to shift microservice traffic in milliseconds without dropping a request.
#Chaos Engineering
#Cilium
#eBPF
ebpf_sockops_redirect.cc
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_endian.h>
struct {
__uint(type, BPF_MAP_TYPE_SOCKHASH);
__uint(max_entries, 65535);
__type(key, struct sock_key);
__type(value, __u64);
} sock_map SEC(".maps");
SEC("sockops")
int bpf_sockmap_tracer(struct bpf_sock_ops *skops) {
if (skops->family == 2) { // AF_INET
switch (skops->op) {
c