Sign inSign up

woozymasta/kube-dump

By woozymasta

Updated 6 days ago

Backup a Kubernetes cluster as yaml manifests

Image
3

100K+

woozymasta/kube-dump repository overview

kube-dump

Git project: WoozyMasta/kube-dump

License: MIT


kube-dump

kube-dump is a utility for preserving the actual state of a Kubernetes environment when it needs to be captured.

In a test namespace, developer sandbox, temporary staging environment, or demonstration environment, state is often changed manually. Someone updates a Deployment, creates a ConfigMap, tries a new operator, writes data to a PVC, or runs a temporary image. That state may be needed again later, even if the environment has already changed or been deleted.

These environments do not always have GitOps, a separate backup system, or a strict lifecycle. That is fine, but important state can still be left without a portable copy.

kube-dump preserves this state in a readable format that can be stored locally, in Git, or in S3-compatible storage and used for recovery.

Installation

Ready-to-use files for the latest stable release:

All published versions are available on GitHub Releases.

With Go 1.27 or newer, install the current version with:

go install github.com/woozymasta/kube-dump/v2/cmd/[email protected]

For running inside Kubernetes, use the ready-made Kustomize components.

The container image is published to:

ghcr.io/woozymasta/kube-dump:2.0.0-rc.1
docker.io/woozymasta/kube-dump:2.0.0-rc.1

For CI, debugging, and scripting, use the image with a shell and additional utilities:

ghcr.io/woozymasta/kube-dump:2.0.0-rc.1-debug
docker.io/woozymasta/kube-dump:2.0.0-rc.1-debug

More installation options are described in the documentation.

What it preserves

kube-dump preserves three independent parts of Kubernetes state:

  • Kubernetes resources - YAML manifests for storing in Git, S3, or an archive;
  • PVC data - file archives that can be read from a CSI snapshot;
  • container images - a standard OCI Image Layout, including temporary images and merge request builds.

Each layer can be saved separately or together with the others.

How to use it

Each data type has its own command. For example, save resources locally:

kube-dump resource save dir ./backup

Or send them to S3-compatible storage:

kube-dump resource save s3 --s3-uri s3://backup/my-cluster/

Save PVC data and container images with the pvc and image commands.

Capture the state before maintenance or an experiment, before cleaning a temporary registry, or before deleting a test environment.

What it does not replace

kube-dump does not replace Argo CD, Flux, Velero, database operators, or an application's own backup mechanisms.

If an application can create a correct logical database backup, continue to use that mechanism. If infrastructure is fully declared in Git, Git remains the source of desired state.

kube-dump captures what actually exists in the cluster at a given moment in a readable and portable form, so it can be used as a basis for recovery.

Profiles and data protection

Profiles define how resources, PVCs, and images are selected and processed. For Kubernetes manifests, they also define cleanup rules and fields to encrypt.

Built-in profiles:

  • backup - backs up configuration, access control, and common operator objects while removing server-generated state;
  • export - creates clean, portable manifests without runtime metadata and empty fields;
  • raw - saves all discovered objects without cleanup or filtering.

Sensitive YAML values can be encrypted with age or deterministic AES-256-SIV. Resource and PVC archives can additionally be protected with age.

More information

This README is not the complete documentation. Installation, commands, profiles, encryption, PVCs, and images are covered in the documentation.

Tag summary

Content type

Image

Digest

Size

32.3 MB

Last updated

over 4 years ago

docker pull woozymasta/kube-dump