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 docsUnified observability — logs, uptime monitoring, and on-call in one place. Used by 50,000+ engineering teams to ship faster and sleep better.
Try Better Stack free →Seamlessly Access Private Git Repositories in EKS with Argo CD
Unlock the power of Argo CD by integrating it with private Git repositories hosted on AWS. Learn how to set up AWS CodeConnections to create a secure network path for your Git server, ensuring smooth deployment workflows.
Mastering Full Request and Response Logging on Amazon EKS
In a world where compliance is non-negotiable, capturing full request and response data is crucial. Learn how Envoy’s External Processing filter enables this without altering your application code.
Mastering EKS Control Plane Egress: Route Your Traffic with Precision
Amazon EKS now allows you to route Kubernetes control plane traffic through your own VPC, giving you greater control over egress traffic. By enabling CUSTOMER_ROUTED mode, you can ensure that API server calls follow your configured routes and security groups.
Get the daily digest
One email. 5 articles. Every morning.
No spam. Unsubscribe anytime.