Mastering Full Request and Response Logging on Amazon EKS
Full request and response compliance logging is essential for maintaining transparency and accountability in microservices architectures. It allows you to capture all aspects of HTTP interactions, which is vital for debugging, auditing, and regulatory compliance. By leveraging Envoy’s External Processing filter, you can log complete request and response data seamlessly, without touching your application code.
When an HTTP request enters your system, it follows a defined path. The client sends an HTTPS request, which is resolved by DNS to a Network Load Balancer (NLB) in your VPC. The NLB forwards this request to the Istio Ingress Gateway within your Amazon EKS cluster. The Ingress Gateway routes the traffic into the service mesh based on Gateway and Virtual Service resources. Once matched, the request hits the Envoy sidecar proxy, which is automatically injected into each pod by Istio. The Envoy sidecar then opens a bidirectional gRPC stream to the external processing service, a standalone Kubernetes Deployment running a gRPC server that implements the Envoy External Processing API. After the ext_proc server approves both the request and response phases, Envoy forwards the complete request to the application container, processes it, and returns the response. This entire interaction culminates in a single audit log entry, correlating all four phases—request headers, request body, response headers, and response body—using the x-request-id header.
In production, ensure you have the necessary tools installed, including AWS CLI, Terraform, and kubectl. The setup involves cloning a sample repository and initializing Terraform to manage your infrastructure. Be aware that you are working with an Amazon EKS 1.35 cluster in Auto Mode, which simplifies node provisioning and scaling. Pay attention to the integration of Envoy and Istio, as misconfigurations can lead to logging gaps or performance issues.
Key takeaways
- →Utilize Envoy’s External Processing filter to capture full request and response data without modifying application code.
- →Ensure your traffic flows through the Istio Ingress Gateway for proper routing and logging.
- →Correlate all four phases of logging using the x-request-id header for comprehensive audit trails.
- →Set up your environment with AWS CLI, Terraform, and other necessary tools before implementation.
- →Monitor your Amazon EKS cluster version to leverage the latest features and improvements.
Why it matters
In production, having complete visibility into request and response data can significantly enhance your ability to troubleshoot issues and ensure compliance with regulatory standards. This transparency is crucial for maintaining trust and accountability in microservices environments.
Code examples
git clone https://github.com/aws-samples/sample-full-request-response-logging-on-eks.git
cd sample-full-request-response-logging-on-ekscd terraform
tf initterraform apply -auto-approveWhen 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.