{"id":13643244,"url":"https://github.com/mhausenblas/reshifter","last_synced_at":"2025-04-21T01:32:16.450Z","repository":{"id":57554654,"uuid":"93248735","full_name":"mhausenblas/reshifter","owner":"mhausenblas","description":"Kubernetes cluster state management","archived":true,"fork":false,"pushed_at":"2018-12-06T08:11:50.000Z","size":4362,"stargazers_count":294,"open_issues_count":12,"forks_count":30,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-11-09T15:42:23.590Z","etag":null,"topics":["backup","cluster","etcd","kubernetes","openshift","restore","upgrades"],"latest_commit_sha":null,"homepage":"https://hackernoon.com/introducing-reshifter-for-kubernetes-backup-restore-migration-upgrade-ffaf78da36","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhausenblas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-03T13:06:59.000Z","updated_at":"2024-05-29T22:51:02.000Z","dependencies_parsed_at":"2022-09-13T03:02:22.760Z","dependency_job_id":null,"html_url":"https://github.com/mhausenblas/reshifter","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhausenblas%2Freshifter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhausenblas%2Freshifter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhausenblas%2Freshifter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhausenblas%2Freshifter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhausenblas","download_url":"https://codeload.github.com/mhausenblas/reshifter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982596,"owners_count":21355731,"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","cluster","etcd","kubernetes","openshift","restore","upgrades"],"created_at":"2024-08-02T01:01:44.476Z","updated_at":"2025-04-21T01:32:13.571Z","avatar_url":"https://github.com/mhausenblas.png","language":"CSS","funding_links":[],"categories":["CSS"],"sub_categories":[],"readme":"# Kubernetes cluster state management\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/mhausenblas/reshifter)](https://goreportcard.com/report/github.com/mhausenblas/reshifter)\n[![godoc](https://godoc.org/github.com/mhausenblas/reshifter?status.svg)](https://godoc.org/github.com/mhausenblas/reshifter)\n[![Docker Repository on Quay](https://quay.io/repository/mhausenblas/reshifter/status \"Docker Repository on Quay\")](https://quay.io/repository/mhausenblas/reshifter)\n[![Swagger API definition](https://img.shields.io/badge/API-Swagger-blue.svg)](https://app.swaggerhub.com/apis/mhausenblas/reshifter/1.0.0)\n[![Proudly packaged with Golang dep](images/NERDY.png)](https://github.com/golang/dep)\n\nReShifter is a Kubernetes cluster state management library and tool.\nYou can use it on the command line for one-off tasks, as a Web app with an UI, or\nin a cron job. It uses the etcd API to query and manipulate the state of\nKubernetes-related objects, supporting legacy (`v2`, `/registry`), modern\n(`v2`/`v3`, `/kubernetes.io`) as well as distro-specific keys such as the ones\nused in the enterprise Kubernetes distro OpenShift.\n\n[![Screen cast: Introducing ReShifter](images/reshifter-demo.png)](https://www.useloom.com/share/e590aedeb95b441fb23ab4f9e9e80c32 \"Introducing ReShifter\")  \n\n- [Use Cases](#use-cases)\n- [Status and roadmap](#status-and-roadmap)\n- [CLI tool](#cli-tool)\n- [Web app](#web-app)\n  - [Deploy app locally](#deploy-app-locally)\n  - [Deploy app in OpenShift](#deploy-app-in-openshift)\n  - [Deploy app in Kubernetes](#deploy-app-in-kubernetes)\n- [Backup strategies](#backup-strategies)\n- [Configuration](#configuration)\n- [Test and development](#test-and-development)\n\n## Use Cases\n\nThere are many cases where ReShifter can be useful for you, for example:\n\n- **Auditing** To comply with regulations, you often have to provide an audit trail. ReShifter allows you to generate one by capturing the state of all objects in a Kubernetes cluster.\n- **Billing** No matter if you charge your (internal) customers by volume or by time, you need to record who has been running what. With ReShifter you can snapshot the state of all objects in a Kubernetes cluster and use this as a basis for billing.\n- **$aving money** When running development or test clusters in a public cloud setting, you might not want to pay for the whole time, only when you actively use it. You can use ReShifter to snapshot the state, shut down the cluster and once ramped up again, restore the state.\n- **Troubleshooting** For any kind of Kubernetes clusters, be it prod or testing, you can use ReShifter to capture the state of the cluster at a certain point in time for offline debugging and troubleshooting or to share the state with a provider, who then can take care of looking into a support case.\n- **Capacity planning** To estimate how many worker nodes you might need to add to your Kubernetes cluster in the future you need to have an idea about the overall load over a longer period of time. ReShifter can help you gathering data points for this capacity planning process.\n- **Upgrading** When you are upgrading a cluster, say, from Kubernetes 1.5 to 1.6, you can use ReShifter to achieve zero-downtime upgrades with minimal manual effort.\n- **Restore** If you are running a Kubernetes cluster in production, you can use ReShifter to back up the current state of the deployed apps. The backup can be useful as a basis for a restore process, into the same or a new cluster.\n- **Disaster Recovery** When operating two or more clusters, you can use ReShifter to replicate the state for DR failover scenarios.\n\n## Status and roadmap\n\nSee the [Trello board](https://trello.com/b/iOrEdJQ3/reshifter) for the current status of the work and roadmap items.\nYou can also check out the design philosophy and [architecture](https://github.com/mhausenblas/reshifter/blob/master/docs/architecture.md)\nof ReShifter, if you want to learn more about why it works the way it does.\n\n## CLI tool\n\nYou can use ReShifter from the CLI via the `rcli` binaries.\nGet binary releases for Linux and macOS via the [GitHub release page](https://github.com/mhausenblas/reshifter/releases/tag/v0.3.22-alpha).\n\n```\n$ rcli -h\nA CLI for ReShifter, supports backing up and restoring Kubernetes clusters.\n\nUsage:\n  rcli [command]\n\nAvailable Commands:\n  backup      Creates a backup of a Kubernetes cluster\n  explore     Probes an etcd endpoint\n  help        Help about any command\n  restore     Performs a restore of a Kubernetes cluster\n  stats       Collects stats about Kubernetes-related keys from an etcd endpoint\n  version     Displays the ReShifter version\n\n...\n```\n\nHere's a simple usage example which assumes that you've got a Kubernetes cluster with an etcd on `http://localhost:4001` running:\n\n```\n# back up Kubernetes cluster to Minio playground:\n$ ACCESS_KEY_ID=Q3AM3UQ867SPQQA43P2F \\\n  SECRET_ACCESS_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG \\\n  rcli backup create --endpoint http://localhost:4001 \\\n                     --remote play.minio.io:9000 \\\n                     --bucket mh9-test\n\n# restore cluster from Minio playground, using backup ID 1498815551:\n$ ACCESS_KEY_ID=Q3AM3UQ867SPQQA43P2F \\\n  SECRET_ACCESS_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG \\\n  rcli restore --endpoint http://localhost:4001 \\\n               --remote play.minio.io:9000 \\\n               --bucket mh9-test \\\n               --backupid 1498815551\n```\n\nOK, now that you know about the basic usage, why not learn more by checking out the [CLI walkthrough](https://github.com/mhausenblas/reshifter/blob/master/docs/walkthroughs.md#cli)?\nYou can also have a look at the backup [strategies](https://github.com/mhausenblas/reshifter/blob/master/docs/strategies.md) as well as\nthe [configuration options](#configuration) for more ways to use the ReShifter CLI most effectively.\n\n## Web app\n\nIf you want to see the app in action, have a look at the [app walkthrough](https://github.com/mhausenblas/reshifter/blob/master/docs/walkthroughs.md#app).\n\n### Deploy app locally\n\nIf you want to use the ReShifter app, that is the Web UI, you need to use the Docker image since it bundles the static assets such as HTML, CSS, and JS and the Go binary.\nFor example, to launch the ReShifter app locally, do:\n\n```\n$ docker run --rm -p 8080:8080 quay.io/mhausenblas/reshifter:0.3.22\n```\n\nIf you want to use the ReShifter API, for example as a head-less service, you can simply use the binary, no other dependencies required:\n\n```\n$ curl -s -L https://github.com/mhausenblas/reshifter/releases/download/v0.3.22-alpha/reshifter -o reshifter\n$ chmod +x reshifter\n$ ./reshifter\n```\n\nThe ReShifter HTTP API is defined in and available via Swagger: [swaggerhub.com/apis/mhausenblas/reshifter/1.0.0](https://swaggerhub.com/apis/mhausenblas/reshifter/1.0.0)\n\n### Deploy app in OpenShift\n\nTo install the ReShifter app on OpenShift, we use a [Makefile](https://github.com/mhausenblas/reshifter/blob/master/Makefile)\nthat creates a new project called `reshifter`, launches the app from the Docker image, and finally exposes the service via a route\nso that you can access the app from outside of the cluster. The following requires access to an OpenShift Origin 1.5 (or OpenShift Container Platform 3.5)\ncluster and also the [oc](https://github.com/openshift/origin/releases/tag/v1.5.1) CLI tool locally installed:\n\n```\n$ make init\n$ make build\n$ make publish\n```\n\n### Deploy app in Kubernetes\n\nTo install the ReShifter app in a portable way, use `kubectl` and the YAML files provided.\nThe following requires access to a vanilla Kubernetes 1.5 or above cluster and also the\n[kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) CLI tool locally installed:\n\n```\n$ kubectl create -f https://raw.githubusercontent.com/mhausenblas/reshifter/master/deployments/reshifter-app.yaml\n```\n\nNote: the above YAML file defines both a `Deployment` as well as a `Service` object for ReShifter.\nIt does, however, not expose the ReShifter service to the outside world. If you want to access the app from outside the cluster,\nyou'll have to use Ingress or adapt the [YAML file](https://github.com/mhausenblas/reshifter/blob/master/deployments/reshifter-app.yaml)\nyourself.\n\n## Backup strategies\n\nReShifter supports different backup [strategies](https://github.com/mhausenblas/reshifter/blob/master/docs/strategies.md).\n\n## Configuration\n\nReShifter takes throughout the deployments (app, HTTP API, CLI) the following configuration parameters,\nsupplied as environment variables. Currently all of them are optional, but may be required depending on the etcd\nsetup in use or what you want to achieve, for example, backing up to an S3-compatible storage.\n\n| env var   | meaning  | set for |\n| ---------:| -------- | ------- |\n| `ACCESS_KEY_ID` | S3 access key ID | when backing up to remote S3-compatible storage |\n| `SECRET_ACCESS_KEY` | S3 secret access key | when backing up to remote S3-compatible storage |\n| `RS_ETCD_CLIENT_CERT` | path to etcd client cert file | when using a secure etcd |\n| `RS_ETCD_CLIENT_KEY` | path to etcd client key file | when using a secure etcd |\n| `RS_ETCD_CA_CERT` | path to etcd CA cert file | when using a secure etcd |\n| `RS_BACKUP_STRATEGY` | if present, selects backup [strategy](https://github.com/mhausenblas/reshifter/blob/master/docs/strategies.md) | for `backup` |\n| `RS_ETCD_API_VERSION` | if present, overwrites auto-discovery and forces ReShifter to use the specified etcd API version; allowed values are `v2` or `v3` | for `backup`, `restore`, and `stats` |\n\nNote:\n\n- The `ACCESS_KEY_ID` and `SECRET_ACCESS_KEY` environment variables are understood as of the AWS [guidelines](http://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html)\n- The `RS_ETCD_*` environment variables are understood as of the etcd2 [security flags](https://coreos.com/etcd/docs/latest/v2/configuration.html#security-flags)/etcd3 [security flags](https://coreos.com/etcd/docs/latest/op-guide/configuration.html#security-flags)\n\n## Test and development\n\nSee the pages for [testbed](https://github.com/mhausenblas/reshifter/tree/master/testbed) and [development](https://github.com/mhausenblas/reshifter/blob/master/docs/dev.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhausenblas%2Freshifter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhausenblas%2Freshifter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhausenblas%2Freshifter/lists"}