A CLI tool that snapshots live Kubernetes cluster resources into a structured local directory tree. Each resource is cleaned through kubectl-neat to strip runtime-only fields (managed fields, last-applied annotations, cluster IPs, resource versions), producing minimal, readable manifests suitable for Git.
kubectl get -o yaml output is cluttered with fields that make diffs noisy and version control impractical. kubedump solves this by discovering all resources of interest, cleaning each one through kubectl-neat, and saving them in a consistent directory layout — one file per resource.
Helm releases are tracked as values.yaml rather than noisy rendered manifests.
<cluster>/
<namespace>/
<Kind>/
<resource-name>.yaml # kubectl-neat cleaned manifest
HelmRelease/
<release-name>/
values.yaml # helm get values output
kubectlon PATHkubectl-neaton PATHhelmon PATH (optional — Helm tracking is skipped gracefully if absent)
git clone https://github.com/SubhrajitPrusty/kubedump.git
cd kubedump
go build -o kubedump .
# Move the binary somewhere on your PATH, e.g.:
mv kubedump /usr/local/bin/Create a kubedump.yaml file in your working directory mapping local directory names to kubectl context names.
And optionally, a list of resource kinds to skip during discover/refresh.
Example kubedump.yaml:
clusters:
api-cluster: arn:aws:eks:ap-south-1:123456789:cluster/api-cluster
ws-cluster: arn:aws:eks:ap-south-1:123456789:cluster/ws-cluster
ignore_kinds:
- ConfigMap
- SecretFetch all resources from every cluster (or a specific one) and write them to the directory tree.
# All clusters from kubedump.yaml
kubedump discover
# Include resources owned by Helm
kubedump discover --include-helm
# Single namespace / explicit context
kubedump discover --namespace default --context my-ctx --cluster my-cluster
# Custom resource kinds
kubedump discover --kinds Deployment,Service,ConfigMapDefault kinds fetched: Deployment, StatefulSet, DaemonSet, CronJob, Service, Ingress, ConfigMap, HorizontalPodAutoscaler, ServiceAccount, PodDisruptionBudget.
Re-fetch every YAML file that already exists in the directory tree from the live cluster. Useful for keeping snapshots up to date without a full rediscover.
kubedump refresh
# Limit to a specific namespace
kubedump refresh --namespace defaultDelete dumped YAML files whose content shows managed-by: Helm. Files inside HelmRelease/ directories are preserved. Empty directories are cleaned up afterwards.
# Preview what would be deleted
kubedump prune-helm --dry-run
# Actually delete
kubedump prune-helm| Flag | Description |
|---|---|
--base-dir <dir> |
Base directory for the dump (default: current directory) |
--dry-run |
Print actions without writing or deleting anything |
go mod tidy
go build -o kubedump .