msfidelis
kubedump
Go

:whale: :package: :rocket: - Simple tool to dump and restore kubernetes resources

Last updated Jun 17, 2026
71
Stars
3
Forks
1
Issues
0
Stars/day
Attention Score
13
Language breakdown
No language data available.
โ–ธ Files click to expand
README

Kubedump - Simple tool to dump and restore kubernetes resources

logo

Documentation License: MIT Build CI Release Twitter: fidelissauro

Introduction

Kubedump is a simple tool to make easy backups and workloads migrations between clusters.

Installation

Docker

docker pull fidelissauro/kubedump:latest
docker run --network -v ~/.kubeconfig:/home/root/.kubeconfig host -it fidelissauro/kubedump:latest dump chip

MacOS amd64

wget https://github.com/msfidelis/kubedump/releases/download/v0.1.8/kubedump0.1.8darwin_arm64 -O kubedump 
mv kubedump /usr/local/bin 
chmod +x /usr/local/bin/kubedump

MacOS arm64

wget https://github.com/msfidelis/kubedump/releases/download/v0.1.8/kubedump0.1.8darwin_amd64 -O kubedump 
mv kubedump /usr/local/bin 
chmod +x /usr/local/bin/kubedump

Linux amd64

wget https://github.com/msfidelis/kubedump/releases/download/v0.1.8/kubedump0.1.8linux_amd64 -O kubedump 
mv kubedump /usr/local/bin 
chmod +x /usr/local/bin/kubedump

Linux arm64

wget https://github.com/msfidelis/kubedump/releases/download/v0.1.8/kubedump0.1.8linux_arm64 -O kubedump 
mv kubedump /usr/local/bin 
chmod +x /usr/local/bin/kubedump

Freebsd amd64

wget https://github.com/msfidelis/kubedump/releases/download/v0.1.8/kubedump0.1.8freebsd_amd64 -O kubedump 
mv kubedump /usr/local/bin 
chmod +x /usr/local/bin/kubedump

Freebsd arm64

wget https://github.com/msfidelis/kubedump/releases/download/v0.1.8/kubedump0.1.8freebsd_arm64 -O kubedump 
mv kubedump /usr/local/bin 
chmod +x /usr/local/bin/kubedump

Usage

kubedump --help

Usage: kubedump [command]

Available Commands: completion Generate the autocompletion script for the specified shell dump dump all resources of a Kubernetes namespace dump-file dump all resources of with file custom configs help Help about any command restore restore all resources dumped using kubedump of a Kubernetes namespace restore-file restore all resources of with custom configs from configuration files

Flags: -h, --help help for kubedump

Use "kubedump [command] --help" for more information about a command.

## Usage - Dump
bash kubedump dump --help

dump all resources of a Kubernetes namespace

Usage: kubedump dump [namespace] [flags]

Flags: -d, --dry-run Perform a dry-run backup (no actual backup will be performed) --format string Dump output format (default "yaml") -h, --help help for dump --kubectl-location string Custom kubectl binary or alias (default "kubectl") --project string Project name (default "kubedump") --resources string Kubernetes resources separated by comma (default "deployment,service,hpa,ingress,serviceaccount,daemonset,statefulset,job,cronjob")

### Dump namespace resources
bash โฏ kubedump dump chip --project cluster_x

2023/08/02 21:48:08 INFO Starting dump namespace=chip 2023/08/02 21:48:08 INFO Dumping resources namespace=chip resource=namespace 2023/08/02 21:48:08 INFO Dumping resources namespace=chip resource=deployment 2023/08/02 21:48:08 INFO Dumping resources namespace=chip resource=service 2023/08/02 21:48:08 INFO Dumping resources namespace=chip resource=hpa 2023/08/02 21:48:08 INFO Dumping resources namespace=chip resource=ingress 2023/08/02 21:48:08 INFO Dumping resources namespace=chip resource=serviceaccount 2023/08/02 21:48:08 INFO Dumping resources namespace=chip resource=daemonset 2023/08/02 21:48:08 INFO Dumping resources namespace=chip resource=statefulset 2023/08/02 21:48:08 INFO Dumping resources namespace=chip resource=job 2023/08/02 21:48:08 INFO Dumping resources namespace=chip resource=cronjob 2023/08/02 21:48:08 INFO Success namespace=chip outputfiles=./clusterx/chip

An folder will be created with project name, with output structure like
โฏ tree cluster_x cluster_x โ””โ”€โ”€ chip โ”œโ”€โ”€ 00-namespace.yaml โ”œโ”€โ”€ cronjob.yaml โ”œโ”€โ”€ daemonset.yaml โ”œโ”€โ”€ deployment.yaml โ”œโ”€โ”€ hpa.yaml โ”œโ”€โ”€ ingress.yaml โ”œโ”€โ”€ job.yaml โ”œโ”€โ”€ service.yaml โ”œโ”€โ”€ serviceaccount.yaml โ””โ”€โ”€ statefulset.yaml
### Dump custom resources
bash kubedump dump chip --project cluster_x --resources deployment,service,hpa,ingress,serviceaccount,daemonset,statefulset,job,cronjob,virtualservice,gateway,destinationrules

2023/08/02 21:49:19 INFO Starting dump namespace=chip 2023/08/02 21:49:19 INFO Dumping resources namespace=chip resource=namespace 2023/08/02 21:49:19 INFO Dumping resources namespace=chip resource=deployment 2023/08/02 21:49:19 INFO Dumping resources namespace=chip resource=service 2023/08/02 21:49:19 INFO Dumping resources namespace=chip resource=hpa 2023/08/02 21:49:19 INFO Dumping resources namespace=chip resource=ingress 2023/08/02 21:49:19 INFO Dumping resources namespace=chip resource=serviceaccount 2023/08/02 21:49:19 WARN No resource found in namespace namespace=chip resource=serviceaccount 2023/08/02 21:49:19 INFO Dumping resources namespace=chip resource=daemonset 2023/08/02 21:49:19 WARN No resource found in namespace namespace=chip resource=daemonset 2023/08/02 21:49:19 INFO Dumping resources namespace=chip resource=statefulset 2023/08/02 21:49:19 WARN No resource found in namespace namespace=chip resource=statefulset 2023/08/02 21:49:19 INFO Dumping resources namespace=chip resource=job 2023/08/02 21:49:19 WARN No resource found in namespace namespace=chip resource=job 2023/08/02 21:49:19 INFO Dumping resources namespace=chip resource=cronjob 2023/08/02 21:49:19 WARN No resource found in namespace namespace=chip resource=cronjob 2023/08/02 21:49:19 INFO Dumping resources namespace=chip resource=virtualservice 2023/08/02 21:49:19 ERRO Error to Dump resource namespace=chip resource=virtualservice file=error exit status 1="missing value" 2023/08/02 21:49:19 INFO Dumping resources namespace=chip resource=gateway 2023/08/02 21:49:19 ERRO Error to Dump resource namespace=chip resource=gateway file=error exit status 1="missing value" 2023/08/02 21:49:19 INFO Dumping resources namespace=chip resource=destinationrules 2023/08/02 21:49:20 ERRO Error to Dump resource namespace=chip resource=destinationrules file=error exit status 1="missing value" 2023/08/02 21:49:20 INFO Success namespace=chip outputfiles=./clusterx/chip

### Dump format option
kubedump dump chip --project cluster_x --format yaml kubedump dump chip --project cluster_y --format json
โฏ tree cluster_x cluster_x โ””โ”€โ”€ chip โ”œโ”€โ”€ 00-namespace.yaml โ”œโ”€โ”€ cronjob.yaml โ”œโ”€โ”€ daemonset.yaml โ”œโ”€โ”€ deployment.yaml โ”œโ”€โ”€ hpa.yaml โ”œโ”€โ”€ ingress.yaml โ”œโ”€โ”€ job.yaml โ”œโ”€โ”€ service.yaml โ”œโ”€โ”€ serviceaccount.yaml โ””โ”€โ”€ statefulset.yaml

1 directory, 10 files โฏ tree cluster_y cluster_y โ””โ”€โ”€ chip โ”œโ”€โ”€ 00-namespace.json โ”œโ”€โ”€ cronjob.json โ”œโ”€โ”€ daemonset.json โ”œโ”€โ”€ deployment.json โ”œโ”€โ”€ hpa.json โ”œโ”€โ”€ ingress.json โ”œโ”€โ”€ job.json โ”œโ”€โ”€ service.json โ”œโ”€โ”€ serviceaccount.json โ””โ”€โ”€ statefulset.json

1 directory, 10 files

## Usage - Restore
bash โฏ kubedump restore --help restore all resources dumped using kubedump of a Kubernetes namespace

Usage: kubedump restore [namespace] [flags]

Flags: --config-file string kubedump config file location -h, --help help for restore --kubectl-location string Custom kubectl binary or alias (default "/usr/local/bin/kubectl") --project string Project name (default "kubedump")

bash kubedump restore chip

2023/08/02 21:50:13 INFO Restoring resources namespace=chip resource=namespace 2023/08/02 21:50:13 INFO Resources restored: namespace=chip resources=kubedump/chip/00-namespace.yaml 2023/08/02 21:50:13 INFO Resources restored: namespace=chip resources=kubedump/chip/deployment.yaml 2023/08/02 21:50:13 INFO Resources restored: namespace=chip resources=kubedump/chip/hpa.yaml 2023/08/02 21:50:13 INFO Resources restored: namespace=chip resources=kubedump/chip/ingress.yaml 2023/08/02 21:50:13 INFO Resources restored: namespace=chip resources=kubedump/chip/service.yaml

## Using Config Files

You can use dump-file and restore-file command with yaml file configuration to automate dumps between a lot of namespaces at same time.

You can create a kubedump-file.yaml example like this:

yaml project: cluster_x format: yaml namespaces: - chip - whois resources: - deployment - service - hpa - ingress - serviceaccount - daemonset - statefulset - jobs - cronjob - secret - configmap

In any case, you can bootstrap a project config file using init command
bash kubedump init --project kubedump 2025/03/23 14:39:31 INFO Initializing project=kubedump 2025/03/23 14:39:31 INFO Project folder created folder=./kubedump/ 2025/03/23 14:39:31 INFO Project file created project=./kubedump/project.yaml
bash kubedump dump-file --config-file kubedump-file.yaml

2023/08/02 21:52:13 INFO Dumping resources namespace=chip resource=namespace 2023/08/02 21:52:13 INFO Dumping resources namespace=chip resource=deployment 2023/08/02 21:52:14 INFO Dumping resources namespace=chip resource=service 2023/08/02 21:52:14 INFO Dumping resources namespace=chip resource=hpa 2023/08/02 21:52:14 INFO Dumping resources namespace=chip resource=ingress 2023/08/02 21:52:14 INFO Dumping resources namespace=chip resource=serviceaccount 2023/08/02 21:52:14 WARN No resource found in namespace namespace=chip resource=serviceaccount 2023/08/02 21:52:14 INFO Success namespace=chip outputfiles=./clusterx/chip 2023/08/02 21:52:14 INFO Dumping resources namespace=whois resource=namespace 2023/08/02 21:52:14 INFO Dumping resources namespace=whois resource=deployment 2023/08/02 21:52:14 INFO Dumping resources namespace=whois resource=service 2023/08/02 21:52:14 INFO Dumping resources namespace=whois resource=hpa 2023/08/02 21:52:14 INFO Dumping resources namespace=whois resource=ingress 2023/08/02 21:52:14 INFO Dumping resources namespace=whois resource=serviceaccount 2023/08/02 21:52:14 WARN No resource found in namespace namespace=whois resource=serviceaccount 2023/08/02 21:52:14 INFO Success namespace=whois outputfiles=./clusterx/whois

bash kubedump restore-file --config-file kubedump-file.yaml

2023/08/02 21:52:45 INFO Restoring resources namespace=chip resource=namespace 2023/08/02 21:52:45 INFO Resources restored: namespace=chip resources=cluster_x/chip/00-namespace.yaml 2023/08/02 21:52:45 INFO Resources restored: namespace=chip resources=cluster_x/chip/deployment.yaml 2023/08/02 21:52:45 INFO Resources restored: namespace=chip resources=cluster_x/chip/hpa.yaml 2023/08/02 21:52:46 INFO Resources restored: namespace=chip resources=cluster_x/chip/ingress.yaml 2023/08/02 21:52:46 INFO Resources restored: namespace=chip resources=cluster_x/chip/service.yaml 2023/08/02 21:52:46 INFO Restoring resources namespace=whois resource=namespace 2023/08/02 21:52:46 INFO Resources restored: namespace=whois resources=cluster_x/whois/00-namespace.yaml 2023/08/02 21:52:46 INFO Resources restored: namespace=whois resources=cluster_x/whois/deployment.yaml 2023/08/02 21:52:46 INFO Resources restored: namespace=whois resources=cluster_x/whois/hpa.yaml 2023/08/02 21:52:46 INFO Resources restored: namespace=whois resources=cluster_x/whois/ingress.yaml 2023/08/02 21:52:46 INFO Resources restored: namespace=whois resources=cluster_x/whois/service.yaml ```

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท msfidelis/kubedump ยท Updated daily from GitHub