Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Header Echo App

A simple, reliable utility built with Flask to inspect and debug incoming HTTP request headers. Whether you are troubleshooting a complex Ingress setup, verifying Load Balancer behavior, or testing connectivity between microservices, this app provides the immediate feedback you need.

Docker Image

💡 Why use this?

  • Infrastructure Auditing: See exactly what headers your Ingress controller or Proxy is adding/modifying (e.g., X-Forwarded-For, X-Real-IP).
  • Connectivity Validation: Quickly verify that your network path is open and your pods are reachable.
  • Ready-to-go: Lightweight, containerized, and configured for both Docker and Kubernetes right out of the box.

🚀 Quick Start

The fastest way to get running is using Docker Hub:

# Run locally on port 9007
docker run -p 9007:9007 dvklvk/header-echo-app:latest

Locally via Docker Compose

If you prefer Compose, just run:

docker-compose up -d

To stop and clean up: docker-compose down


🔌 API Reference

Health Check

GET /header-echo/health Response: {"status": "healthy"}

Echo Headers

ANY /header-echo/<any-path> This endpoint catches all methods (GET, POST, etc.) and echoes back everything it receives.

Example Request:

curl -H "X-Debug: Senior-Engineer" http://localhost:9007/header-echo/debug-test

Example Response:

{
    "headers": {
        "Host": "localhost:9007",
        "User-Agent": "curl/8.1.2",
        "X-Debug": "Senior-Engineer"
    },
    "message": "Headers received successfully",
    "method": "GET",
    "path": "/debug-test"
}

☸️ Kubernetes & Infrastructure Testing

This project is tailored for Kubernetes debugging. Resources are isolated in the header-echo namespace.

Deployment

Apply all manifests in the k8s/ directory:

make k8s-apply

This sets up a Namespace, Deployment, Service, and Ingress.

Accessing on Minikube

  • Port Forwarding: kubectl port-forward svc/header-echo 9007:80 -n header-echo
  • Ingress:
    1. Enable the addon: minikube addons enable ingress
    2. Start the tunnel: minikube tunnel (keep this running)
    3. Access via: http://127.0.0.1/header-echo

Note for WSL2 Users: If you are using the docker driver, the Minikube IP is not directly routable from Windows. minikube tunnel bridges the Ingress to 127.0.0.1, so use localhost instead of the Minikube IP.

Cleanup

make k8s-delete

⚙️ Configuration & Tools

The app can be tuned via environment variables:

Variable Default Purpose
PORT 9007 The port the app listens on.
APP_PREFIX /header-echo The base path for the API.

Makefile Support

A Makefile is included to streamline your workflow:

  • make build: Build the image locally.
  • make push: Push the image to your registry.
  • make k8s-apply: Deploy the full K8s stack.
  • make k8s-delete: Teardown everything.

⚖️ License

Distributed under the MIT License. See LICENSE for more information.


Crafted for Platform Engineers by a Senior Platform Engineer.

About

A simple, reliable utility built with Flask to inspect and debug incoming HTTP request headers.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages