A collection of purpose-built container images and Kubernetes manifests for debugging and troubleshooting applications running in Kubernetes clusters.
k8s-debug-pods/
├── images/ # Container image definitions
│ ├── mysql/ # MySQL client tools
│ │ ├── 8.0/
│ │ │ └── Dockerfile
│ │ ├── 8.4/
│ │ │ └── Dockerfile
│ │ └── 9.5.0/
│ │ └── Dockerfile
│ ├── network/ # Network debugging tools
│ │ └── debug/
│ │ └── Dockerfile
│ ├── postgresql/ # PostgreSQL client tools
│ │ ├── 13/
│ │ │ └── Dockerfile
│ │ ├── 14/
│ │ │ └── Dockerfile
│ │ └── 15/
│ │ └── Dockerfile
│ └── ruby/ # Ruby development tools
│ ├── 3.3/
│ │ └── Dockerfile
│ ├── 3.4/
│ │ └── Dockerfile
│ └── 4.0/
│ └── Dockerfile
├── pods/ # Kubernetes pod manifests
│ ├── mysql/
│ │ ├── 8.0.yml
│ │ ├── 8.4.yml
│ │ ├── 9.5.0.yml
│ │ └── percona-8.0.yml
│ ├── network/
│ │ └── debug.yml
│ ├── postgresql/
│ │ ├── 13.yml
│ │ ├── 14.yml
│ │ ├── 15.yml
│ │ └── percona-13.yml
│ └── ruby/
│ ├── 3.3.yml
│ ├── 3.4.yml
│ └── 4.0.yml
├── bin/ # Deployment helper scripts
│ ├── deploy-debug-pod
│ └── cleanup-debug-pods
├── .github/
│ └── workflows/ # CI/CD automation
└── renovate.json # Automated dependency updates
Network troubleshooting tools for diagnosing connectivity issues.
Image: ghcr.io/c-gerke/k8s-debug-pods/network-debug:latest
Source: images/network/debug/Dockerfile
Installed Tools:
curl- HTTP clientwget- File downloaderdig/nslookup- DNS lookup utilitiesping- ICMP connectivity testingnetstat/ss- Network statisticsip/ifconfig- Network interface configurationtelnet- TCP connection testingnetcat- Network utility
Usage:
kubectl run network-debug --rm -it \
--image=ghcr.io/c-gerke/k8s-debug-pods/network-debug:latest \
--restart=Never \
-- /bin/bashOr apply the pod manifest directly:
kubectl apply -f pods/network/debug.yml
kubectl exec -it network-debug-pod -- /bin/bashOr using the deployment script:
./bin/deploy-debug-pod --auto network/debugMySQL database client tools for debugging and troubleshooting MySQL databases. These images use the official MySQL client tools matching specific MySQL server versions.
Note: These images are based on official MySQL Docker images and provide the exact MySQL client version specified.
Image: ghcr.io/c-gerke/k8s-debug-pods/mysql-8.0:latest
Source: images/mysql/8.0/Dockerfile
Client: MySQL 8.0.43
Installed Tools:
mysql- MySQL client (8.0.43)mysqldump- Database backup utilitymysqladmin- Server administration utilitycurl- HTTP clientwget- File downloader
Usage:
kubectl run mysql-8.0 --rm -it \
--image=ghcr.io/c-gerke/k8s-debug-pods/mysql-8.0:latest \
--restart=Never \
-- /bin/bashOr apply the pod manifest directly:
kubectl apply -f pods/mysql/8.0.yml
kubectl exec -it mysql-debug-8.0-pod -- /bin/bashOr using the deployment script:
./bin/deploy-debug-pod --auto mysql/8.0Example connection to a MySQL database:
# Inside the debug pod
mysql -h mysql-service.default.svc.cluster.local -u root -p
# Dump a database
mysqldump -h mysql-service.default.svc.cluster.local -u root -p mydb > backup.sqlImage: ghcr.io/c-gerke/k8s-debug-pods/mysql-8.4:latest
Source: images/mysql/8.4/Dockerfile
Client: MySQL 8.4.5
Installed Tools:
mysql- MySQL client (8.4.5)mysqldump- Database backup utilitymysqladmin- Server administration utilitycurl- HTTP clientwget- File downloader
Note: MySQL 8.4 no longer includes mysqlshow as it has been deprecated.
Usage:
kubectl run mysql-8.4 --rm -it \
--image=ghcr.io/c-gerke/k8s-debug-pods/mysql-8.4:latest \
--restart=Never \
-- /bin/bashOr apply the pod manifest directly:
kubectl apply -f pods/mysql/8.4.yml
kubectl exec -it mysql-debug-8.4-pod -- /bin/bashOr using the deployment script:
./bin/deploy-debug-pod --auto mysql/8.4Image: ghcr.io/c-gerke/k8s-debug-pods/mysql-9.5.0:latest
Source: images/mysql/9.5.0/Dockerfile
Client: MySQL 9.5.0
Installed Tools:
mysql- MySQL client (9.5.0)mysqldump- Database backup utilitymysqladmin- Server administration utilitycurl- HTTP clientwget- File downloader
Usage:
kubectl run mysql-9.5.0 --rm -it \
--image=ghcr.io/c-gerke/k8s-debug-pods/mysql-9.5.0:latest \
--restart=Never \
-- /bin/bashOr apply the pod manifest directly:
kubectl apply -f pods/mysql/9.5.0.yml
kubectl exec -it mysql-debug-9.5.0-pod -- /bin/bashOr using the deployment script:
./bin/deploy-debug-pod --auto mysql/9.5.0Example connection to a MySQL database:
# Inside the debug pod
mysql -h mysql-service.default.svc.cluster.local -u root -p
# Dump a database
mysqldump -h mysql-service.default.svc.cluster.local -u root -p mydb > backup.sqlImage: percona:8.0.36-28@sha256:1128d56e64711ed65cb0c57041048967ee5875a2167d708d327885fd1f995fa0
Source: External Percona image (not built by this repository)
Client: Percona Server 8.0.36-28
Installed Tools:
mysql- Percona MySQL client (8.0.36-28)mysqldump- Database backup utilitymysqladmin- Server administration utilitycurl- HTTP clientmysqlsh- MySQL Shellmysqlbinlog- Binary log utilitymysqlcheck- Table maintenance utility- Additional Percona-specific tools and utilities
Usage:
kubectl apply -f pods/mysql/percona-8.0.yml
kubectl exec -it mysql-percona-debug-8.0-pod -- /bin/bashOr using the deployment script:
./bin/deploy-debug-pod --auto mysql/percona-8.0Example connection to a MySQL database:
# Inside the debug pod
mysql -h mysql-service.default.svc.cluster.local -u root -p
# Dump a database
mysqldump -h mysql-service.default.svc.cluster.local -u root -p mydb > backup.sqlNote: This pod uses the official Percona Server image with SHA pinning for reproducibility, matching production infrastructure.
PostgreSQL database debugging and development tools for database administration and troubleshooting. Available in multiple PostgreSQL versions.
Image: ghcr.io/c-gerke/k8s-debug-pods/postgresql-13:latest
PostgreSQL Version: 13 (latest patch version)
Installed Tools:
psql- PostgreSQL interactive terminal (13.x)pg_dump- PostgreSQL database backup utilitypg_restore- PostgreSQL database restoration utilitypg_isready- Check PostgreSQL server availabilitycreatedb- Create a PostgreSQL databasedropdb- Remove a PostgreSQL databasecurl- HTTP clientwget- File downloader
Usage:
kubectl run postgresql-13 --rm -it \
--image=ghcr.io/c-gerke/k8s-debug-pods/postgresql-13:latest \
--restart=Never \
-- /bin/bashOr apply the pod manifest directly:
kubectl apply -f pods/postgresql-13.yml
kubectl exec -it postgresql-13-pod -- /bin/bashOr using the deployment script:
./bin/deploy-debug-pod --auto postgresql-13Example connection to a PostgreSQL database:
# Inside the debug pod
psql -h postgres-service.default.svc.cluster.local -U myuser -d mydb
# Check if PostgreSQL is ready
pg_isready -h postgres-service.default.svc.cluster.local -p 5432
# Dump a database
pg_dump -h postgres-service.default.svc.cluster.local -U myuser mydb > backup.sql
# Restore a database
pg_restore -h postgres-service.default.svc.cluster.local -U myuser -d mydb backup.sqlImage: ghcr.io/c-gerke/k8s-debug-pods/postgresql-14:latest
PostgreSQL Version: 14 (latest patch version)
Installed Tools:
psql- PostgreSQL interactive terminal (14.x)pg_dump- PostgreSQL database backup utilitypg_restore- PostgreSQL database restoration utilitypg_isready- Check PostgreSQL server availabilitycreatedb- Create a PostgreSQL databasedropdb- Remove a PostgreSQL databasecurl- HTTP clientwget- File downloader
Usage:
kubectl run postgresql-14 --rm -it \
--image=ghcr.io/c-gerke/k8s-debug-pods/postgresql-14:latest \
--restart=Never \
-- /bin/bashOr apply the pod manifest directly:
kubectl apply -f pods/postgresql-14.yml
kubectl exec -it postgresql-14-pod -- /bin/bashOr using the deployment script:
./bin/deploy-debug-pod --auto postgresql-14Image: ghcr.io/c-gerke/k8s-debug-pods/postgresql-15:latest
PostgreSQL Version: 15 (latest patch version)
Installed Tools:
psql- PostgreSQL interactive terminal (15.x)pg_dump- PostgreSQL database backup utilitypg_restore- PostgreSQL database restoration utilitypg_isready- Check PostgreSQL server availabilitycreatedb- Create a PostgreSQL databasedropdb- Remove a PostgreSQL databasecurl- HTTP clientwget- File downloader
Usage:
kubectl run postgresql-15 --rm -it \
--image=ghcr.io/c-gerke/k8s-debug-pods/postgresql-15:latest \
--restart=Never \
-- /bin/bashOr apply the pod manifest directly:
kubectl apply -f pods/postgresql-15.yml
kubectl exec -it postgresql-15-pod -- /bin/bashOr using the deployment script:
./bin/deploy-debug-pod --auto postgresql-15Image: percona/percona-postgresql-operator:2.5.0-ppg13-postgres
Source: External Percona PostgreSQL Operator image (not built by this repository)
PostgreSQL Version: 13 (Percona PostgreSQL)
Installed Tools:
psql- PostgreSQL interactive terminal (13.16 - Percona Distribution)pg_dump- PostgreSQL database backup utilitypg_restore- PostgreSQL database restoration utilitypg_isready- Check PostgreSQL server availabilitycreatedb- Create a PostgreSQL databasedropdb- Remove a PostgreSQL databasecurl- HTTP clientpgbackrest- Backup and restore utilitypg_repack- Remove bloat from tables and indexespg_basebackup- Base backup utility- Additional Percona-specific PostgreSQL tools and utilities
Usage:
kubectl apply -f pods/postgresql/percona-13.yml
kubectl exec -it postgresql-percona-debug-13-pod -- /bin/bashOr using the deployment script:
./bin/deploy-debug-pod --auto postgresql/percona-13Example connection to a PostgreSQL database:
# Inside the debug pod
psql -h postgres-service.default.svc.cluster.local -U myuser -d mydb
# Check if PostgreSQL is ready
pg_isready -h postgres-service.default.svc.cluster.local -p 5432
# Dump a database
pg_dump -h postgres-service.default.svc.cluster.local -U myuser mydb > backup.sql
# Restore a database
pg_restore -h postgres-service.default.svc.cluster.local -U myuser -d mydb backup.sqlNote: This pod uses the Percona PostgreSQL Operator image, matching production infrastructure for Percona PostgreSQL deployments.
Ruby development and debugging tools for working with Ruby applications. Available in multiple Ruby versions.
Image: ghcr.io/c-gerke/k8s-debug-pods/ruby-3.3:latest
Ruby Version: 3.3.10
Installed Tools:
ruby- Ruby interpreter (3.3.10)irb- Interactive Ruby shell (1.13.1)gem- Ruby package manager (3.5.22)bundler- Ruby dependency manager (2.5.22)git- Version control (for fetching dependencies)curl/wget- HTTP clientsvim- Text editorbuild-essential- C compiler and build tools (for native gem extensions)- Development libraries:
libssl-dev,libreadline-dev,zlib1g-dev
Usage:
kubectl run ruby-3.3 --rm -it \
--image=ghcr.io/c-gerke/k8s-debug-pods/ruby-3.3:latest \
--restart=Never \
-- /bin/bashOr apply the pod manifest directly:
kubectl apply -f pods/ruby-3.3.yml
kubectl exec -it ruby-3.3-pod -- /bin/bashOr using the deployment script:
./bin/deploy-debug-pod --auto ruby-3.3Image: ghcr.io/c-gerke/k8s-debug-pods/ruby-3.4:latest
Ruby Version: 3.4.7
Installed Tools:
ruby- Ruby interpreter (3.4.7)irb- Interactive Ruby shell (1.14.3)gem- Ruby package manager (3.6.9)bundler- Ruby dependency manager (2.6.9)git- Version control (for fetching dependencies)curl/wget- HTTP clientsvim- Text editorbuild-essential- C compiler and build tools (for native gem extensions)- Development libraries:
libssl-dev,libreadline-dev,zlib1g-dev
Usage:
kubectl run ruby-3.4 --rm -it \
--image=ghcr.io/c-gerke/k8s-debug-pods/ruby-3.4:latest \
--restart=Never \
-- /bin/bashOr apply the pod manifest directly:
kubectl apply -f pods/ruby-3.4.yml
kubectl exec -it ruby-3.4-pod -- /bin/bashOr using the deployment script:
./bin/deploy-debug-pod --auto ruby-3.4Image: ghcr.io/c-gerke/k8s-debug-pods/ruby-4.0:latest
Ruby Version: 4.0.x
Installed Tools:
ruby- Ruby interpreter (4.0.x)irb- Interactive Ruby shellgem- Ruby package managerbundler- Ruby dependency managergit- Version control (for fetching dependencies)curl/wget- HTTP clientsvim- Text editorbuild-essential- C compiler and build tools (for native gem extensions)- Development libraries:
libssl-dev,libreadline-dev,zlib1g-dev
Usage:
kubectl run ruby-4.0 --rm -it \
--image=ghcr.io/c-gerke/k8s-debug-pods/ruby-4.0:latest \
--restart=Never \
-- /bin/bashOr apply the pod manifest directly:
kubectl apply -f pods/ruby/4.0.yml
kubectl exec -it ruby-4.0-pod -- /bin/bashOr using the deployment script:
./bin/deploy-debug-pod --auto ruby/4.0For easier deployment with intelligent resource allocation, use the provided scripts:
# Deploy to specific context and namespace
./bin/deploy-debug-pod -c my-context -n my-namespace network/debug
# Deploy and automatically exec into the pod
./bin/deploy-debug-pod --auto postgresql/15
# Override resources (useful for constrained environments)
./bin/deploy-debug-pod -m 256Mi -e 256Mi mysql/8.0
# List all debug pods in a namespace
./bin/cleanup-debug-pods -n my-namespace
# Clean up all debug pods
./bin/cleanup-debug-pods -n my-namespace --allThe deployment script:
- Automatically calculates appropriate resource allocations based on namespace quotas
- Uses pod manifests as templates (maintains volumes, commands, etc.)
- Steps up in 64Mi increments from 128Mi default
- Leaves 20% buffer for other pods in the namespace
- Caps at 1Gi maximum regardless of quota
- Supports manual resource overrides
- Safe by default: Won't recreate existing pods (use --force to recreate)
See bin/README.md for detailed usage and examples.
-
Create a new directory under
images/organized by category and version:mkdir -p images/category/version # Example: images/redis/7.0 -
Add a
Dockerfilein that directory:touch images/category/version/Dockerfile # Example: images/redis/7.0/Dockerfile -
Build your Dockerfile following these guidelines:
- Use
debian:bookworm-slimas base for consistency - Install only necessary tools
- Clean up apt cache to minimize image size
- Set appropriate CMD or ENTRYPOINT
- Use
-
Create a corresponding pod manifest in
pods/:mkdir -p pods/category touch pods/category/version.yml # Example: pods/redis/7.0.yml -
Update the manifest to reference the correct image:
image: ghcr.io/c-gerke/k8s-debug-pods/category-version:latest # Example: ghcr.io/c-gerke/k8s-debug-pods/redis-7.0:latest
-
Add tests to
.github/workflows/build-images.ymlfor the new image -
Commit and push the changes:
git add images/category/ pods/category/ git commit -m "Add category/version debug image" git push -
GitHub Actions will automatically build and push the image to:
ghcr.io/c-gerke/k8s-debug-pods/category-version:latest
You can also create pod manifests that use external images directly (e.g., Percona, Redis official images) without building custom images:
-
Create a pod manifest in
pods/:mkdir -p pods/category touch pods/category/external-version.yml # Example: pods/mysql/percona-8.0.yml -
Reference the external image directly:
image: percona:8.0.36-28@sha256:1128d56e64711ed65cb0c57041048967ee5875a2167d708d327885fd1f995fa0 # Use SHA pinning for production images
-
Update documentation with the external image details
-
Commit and push:
git add pods/category/ git commit -m "Add category/external-version pod using external image" git push
This approach is useful when you want to match production infrastructure exactly (e.g., using Percona images that match your database servers).
When a Dockerfile is modified in the images/ directory:
- GitHub Actions detects the change
- Builds the affected image(s) using Docker Buildx
- Runs comprehensive tests to verify all tools work correctly
- Tags with multiple formats (latest, branch name, full git commit hash)
- Pushes to GitHub Container Registry (ghcr.io) only if tests pass
- Builds for linux/amd64 platform
Every image is tested before being pushed to ensure quality:
- Common tests: Verify bash and basic functionality
- Tool-specific tests: Validate all documented tools work correctly
- Version verification: Ensure correct versions are installed (e.g., PostgreSQL 15.x, Ruby 3.4.x, MySQL 8.0.x)
- Fail-fast: Build fails immediately if any test fails
Example tests for postgresql-15:
- PostgreSQL 15.x version verification
- psql, pg_dump, pg_restore, pg_isready functionality
- curl and wget availability
Example tests for mysql/8.0:
- MySQL 8.0.x version verification
- mysql, mysqldump, mysqladmin functionality
- curl and wget availability
This testing framework enables safe auto-merging of dependency updates. See .github/TESTING.md for details.
Renovate automatically:
- Monitors base images in all Dockerfiles
- Creates PRs for updates
- Auto-merges minor and patch version updates (after tests pass)
- Requires manual approval for major version updates
- Tests ensure no breaking changes reach production
- Kubernetes cluster with appropriate RBAC permissions
- Access to pull from GitHub Container Registry (public by default)
kubectlconfigured with cluster accessyqYAML processor (install withbrew install yqon macOS)
To build and test images locally:
cd images/network/debug
docker build -t network-debug:local .
docker run --rm -it network-debug:localWhen adding new images:
- Keep images focused on specific debugging tasks
- Document installed tools in this README
- Follow Debian bookworm-slim base image convention
- Optimize for size by cleaning up package manager caches