{"id":13602825,"url":"https://github.com/WoozyMasta/kube-dump","last_synced_at":"2025-04-11T13:31:31.799Z","repository":{"id":41295915,"uuid":"335466387","full_name":"WoozyMasta/kube-dump","owner":"WoozyMasta","description":"Backup a Kubernetes cluster as a yaml manifest","archived":false,"fork":false,"pushed_at":"2024-01-31T21:36:35.000Z","size":366,"stargazers_count":324,"open_issues_count":16,"forks_count":66,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-10-30T00:16:06.719Z","etag":null,"topics":["backup","backup-script","backup-tool","bash","k8s","kubectl","kubernetes"],"latest_commit_sha":null,"homepage":"https://kube-dump.woozymasta.ru","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WoozyMasta.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-03T00:53:49.000Z","updated_at":"2024-10-29T10:02:45.000Z","dependencies_parsed_at":"2024-06-20T10:20:27.222Z","dependency_job_id":"6ef0b48f-afad-4f24-9ea6-bf2306660c59","html_url":"https://github.com/WoozyMasta/kube-dump","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoozyMasta%2Fkube-dump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoozyMasta%2Fkube-dump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoozyMasta%2Fkube-dump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoozyMasta%2Fkube-dump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WoozyMasta","download_url":"https://codeload.github.com/WoozyMasta/kube-dump/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223470266,"owners_count":17150524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","backup-script","backup-tool","bash","k8s","kubectl","kubernetes"],"created_at":"2024-08-01T18:01:39.144Z","updated_at":"2024-11-07T06:30:24.824Z","avatar_url":"https://github.com/WoozyMasta.png","language":"Shell","funding_links":[],"categories":["Shell","bash"],"sub_categories":[],"readme":"# Kube-dump \u003c!-- omit in toc --\u003e\n\nBackup a Kubernetes cluster as a yaml manifest.\n\n![Logo](https://raw.githubusercontent.com/WoozyMasta/kube-dump/master/extras/logo-wide.png)\n\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/WoozyMasta/kube-dump?style=flat-square)\n![GitHub branch checks state](https://img.shields.io/github/checks-status/WoozyMasta/kube-dump/master?style=flat-square)\n![GitHub](https://img.shields.io/github/license/WoozyMasta/kube-dump?style=flat-square)\n![GitHub last commit](https://img.shields.io/github/last-commit/WoozyMasta/kube-dump?style=flat-square)\n![Docker Pulls](https://img.shields.io/docker/pulls/woozymasta/kube-dump?style=flat-square)\n![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/woozymasta/kube-dump?style=flat-square)\n![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/woozymasta/kube-dump?sort=semver\u0026style=flat-square)\n\n* [Description](#description)\n* [Quick Start Guides](#quick-start-guides)\n* [Container Images](#container-images)\n* [Dependencies](#dependencies)\n* [Commands and flags](#commands-and-flags)\n* [Environment variables](#environment-variables)\n* [Resources default's](#resources-defaults)\n* [Plans for further development](#plans-for-further-development)\n\n## Description\n\nWith this utility you can save your cluster resources as nice yaml\nmanifests without unnecessary metadata.\n\nKey features:\n\n* Saving only those resources to which you have read access;\n* Can work with a list of namespaces otherwise all available ones will be used;\n* Can save both namespaced and cluster wide resources;\n* You can run locally, in a container or in a cluster;\n* Can archive and rotate dump archives;\n* Can commit dumps to a git repository and send to a remote repository;\n* You can specify a list of resources to be dumped;\n* It is possible to configure via command line arguments as well as via\n  environment variables.\n\n[![asciicast](https://raw.githubusercontent.com/WoozyMasta/kube-dump/master/extras/kube-dump.gif)](https://asciinema.org/a/3FfZlP011rF0gj443QnuWdNFE)\n\n## Quick Start Guides\n\n* [Run on a local machine](./docs/local.md)\n  (dependencies and a config for kubectl are required)\n* [Run in container](./docs/container.md)\n  (docker, podman, etc. required and a config for kubectl)\n* [Run in kubernetes as pod](./docs/pod.md)\n  (requires access to the kubernetes cluster and config for kubectl)\n* [Run in kubernetes as a cron job using a service account](./docs/cronjob.md)\n  (requires access to the kubernetes cluster and\n  the ability to create a role or cluster role)\n\n## Container Images\n\n* [`docker pull ghcr.io/woozymasta/kube-dump:1.1.1`](https://github.com/WoozyMasta/kube-dump/pkgs/container/kube-dump)\n* [`docker pull quay.io/woozymasta/kube-dump:1.1.1`](https://quay.io/repository/woozymasta/kube-dump)\n* [`docker pull docker.io/woozymasta/kube-dump:1.1.1`](https://hub.docker.com/r/woozymasta/kube-dump)\n\n## Dependencies\n\nRequired dependencies:\n\n* [`kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/) -\n  Kubernetes command-line tool\n* [`jq`](https://github.com/stedolan/jq) - Command-line JSON processor\n* [`yq`](https://github.com/mikefarah/yq) - Command-line YAML processor\n\nOptional dependencies:\n\n* `curl` - Used to check kubernetes api livez probe when use serviceaccount\n* `git` - Used to store backups as a git repository\n* `tar` - Used to create backup archives with one of the compression libraries:\n  * `xz` - a lossless data compression file format based on the LZMA algorithm\n  * `gzip` - single-file/stream lossless data compression utility\n  * `bzip2` - compression program that uses the Burrows–Wheeler algorithm\n\n## Commands and flags\n\n```text\n./kube-dump [command] [[flags]]\n\nAvailable Commands:\n  all, dump                     Dump all kubernetes resources\n  ns,  dump-namespaces          Dump namespaced kubernetes resources\n  cls, dump-cluster             Dump cluster wide kubernetes resources\n\nThe command can also be passed through the environment variable MODE.\nAll flags presented below have a similar variable in uppercase, with underscores\nFor example:\n  --destination-dir == DESTINATION_DIR \n\nFlags:\n  -h, --help                  This help\n  -s, --silent                Execute silently, suppress all stdout messages\n  -d, --destination-dir       Path to dir for store dumps, default ./data\n  -f, --force-remove          Delete resources in data directory before launch\n      --detailed              Do not remove detailed state specific fields\n      --output-by-type        Organize output into directories by resource type\n      --flat                  Organize all resources of the same type in the\n                              same file\n\nKubernetes flags:\n  -n, --namespaces            List of kubernetes namespaces\n  -r, --namespaced-resources  List of namespaced resources\n  -k, --cluster-resources     List of cluster resources\n      --kube-config           Path to kubeconfig file\n      --kube-context          The name of the kubeconfig context to use\n      --kube-cluster          The name of the kubeconfig cluster to use\n      --kube-insecure-tls     Skip check server's certificate for validity\n\nGit commit flags:\n  -c, --git-commit            Commit changes\n  -p, --git-push              Commit changes and push to origin\n  -b, --git-branch            Branch name\n      --git-commit-user       Commit author username\n      --git-commit-email      Commit author email\n      --git-remote-name       Remote repo name, defualt is origin\n      --git-remote-url        Remote repo URL\n\nArchivate flags:\n  -a, --archivate             Create archive of data dir\n      --archive-rotate-days   Rotate archives older than N days\n      --archive-type          Archive type xz, gz or bz2, default is tar\n\nExample of use:\n  $cmd dump-namespaces -n default,dev -d /mnt/dump -spa --archive-type gz\n```\n\n## Environment variables\n\nAll environment variables are described in the [`.env`](./.env) file,\nyou can use them both for the container launch configuration and\ndirectly from the [`.env`](./.env) file, it is read automatically at startup.\n\n## Resources default's\n\nAll resources automatically discovered from the API if not pass as argument.\n\n* List of namespaces\n* List of default namespaced resources\n* List of default cluster wide resources\n\n## Plans for further development \n\n* Sending dumps to s3 bucket;\n* Sending notifications by email and webhook;\n* Git-crypt to encrypt secrets;\n* Bash autocomplete.\n\n\u003c!--\nTitle: Kube-dump\nDescription: Backup a Kubernetes cluster as a yaml manifest.\nAuthor: WoozyMasta\nKeywords:\n  kubernetes save deployment yaml\n  kubectl get yaml file\n  kubectl get yaml from service\n  kubectl get deployment yaml\n  kubectl save yaml\n  kubectl generate yaml\n  kubernetes json to yaml\n  kubernetes export deployment yaml\n  kubernetes dump yaml\n  kubectl dump yaml\n  kubectl describe to yaml\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWoozyMasta%2Fkube-dump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWoozyMasta%2Fkube-dump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWoozyMasta%2Fkube-dump/lists"}