Injecting Chaos: My LFX Mentorship with kgateway
In today's cloud-native environments, ensuring service resilience is non-negotiable. That's where kgateway comes in, providing a robust foundation for managing traffic in Kubernetes. My journey through the LFX Mentorship Program centered on enhancing kgateway by integrating chaos engineering support, specifically through HTTP fault injection. This capability allows platform teams to deliberately introduce failures like delays and aborts, validating their services' resilience before these issues arise in production.
The implementation involved extending the TrafficPolicy to support fault injection. This included delay injection, abort injection using both HTTP and gRPC status codes, and response rate limiting. Additionally, I introduced a per-route override to disable these features when necessary. Under the hood, this functionality maps to the Envoy HTTP fault filter, which is added to the filter chain but remains disabled by default. This selective enabling per route or virtual host allows for granular control over how and when to test service resilience.
In production, it's crucial to understand that chaos engineering is not just about injecting faults; it's about learning how your system behaves under stress. With five years of experience in cloud-native API gateways and networking, I was well-prepared to navigate the complexities of Go, Kubernetes, and Envoy Proxy. However, be mindful of the potential pitfalls of chaos engineering—it's easy to overwhelm your system or misinterpret the results if not done thoughtfully.
Key takeaways
- →Implement fault injection support by extending TrafficPolicy in kgateway.
- →Use delay and abort injection to simulate real-world failures in your services.
- →Leverage Envoy HTTP fault filter for granular control over traffic management.
- →Enable fault injection selectively per route or virtual host to avoid unnecessary disruptions.
- →Understand the importance of chaos engineering in validating service resilience.
Why it matters
In production, chaos engineering can significantly reduce downtime and improve service reliability by proactively identifying weaknesses. This approach fosters a culture of resilience within your engineering teams.
When NOT to use this
The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.
Want the complete reference?
Read official docs35% off the CKA and other certifications with code OCT26NONCYBER, or 40% off Kubernetes security certs (CKS, KCSA) with OCT26CYBER.
CiliumCon Returns: Scaling eBPF Networking at KubeCon 2026
CiliumCon is back, and it's crucial for anyone involved in Kubernetes networking. With Cilium as the de facto CNI, understanding its eBPF foundation is key to managing workloads at scale. Don't miss out on the insights that could elevate your cloud-native architecture.
OVHcloud Joins CNCF: What This Means for Kubernetes in Europe
The CNCF's new partnership with OVHcloud marks a significant shift for Kubernetes in Europe. With OVHcloud operating thousands of production Kubernetes clusters using Cilium, this collaboration promises enhanced networking and security for multi-tenant environments.
Migrating to ALB: Mastering oauth2-proxy in Kubernetes
Switching from NGINX Ingress to ALB can be tricky, especially when handling oauth2-proxy. Learn how to configure oauth2-proxy to work seamlessly with ALB's OIDC authentication capabilities.
Get the daily digest
One email. 5 articles. Every morning.
No spam. Unsubscribe anytime.