{"id":17601121,"url":"https://github.com/nikoshet/snap-kube","last_synced_at":"2025-04-13T14:34:05.338Z","repository":{"id":258390441,"uuid":"867678547","full_name":"nikoshet/snap-kube","owner":"nikoshet","description":"Rust tool that supports PVC snapshots across Kubernetes namespaces","archived":false,"fork":false,"pushed_at":"2024-10-18T17:18:12.000Z","size":31,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T05:33:49.221Z","etag":null,"topics":["aws","backup","ebs","k8s","kubernetes","pvc","restore","snapshot"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/snap-kube","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikoshet.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-10-04T14:08:59.000Z","updated_at":"2024-11-07T10:21:34.000Z","dependencies_parsed_at":"2024-10-18T19:34:06.397Z","dependency_job_id":"b23f23e7-dcfe-4eac-8852-028f82577a8f","html_url":"https://github.com/nikoshet/snap-kube","commit_stats":null,"previous_names":["nikoshet/snap-kube"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoshet%2Fsnap-kube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoshet%2Fsnap-kube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoshet%2Fsnap-kube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoshet%2Fsnap-kube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikoshet","download_url":"https://codeload.github.com/nikoshet/snap-kube/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248728624,"owners_count":21152257,"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":["aws","backup","ebs","k8s","kubernetes","pvc","restore","snapshot"],"created_at":"2024-10-22T12:08:40.562Z","updated_at":"2025-04-13T14:34:05.310Z","avatar_url":"https://github.com/nikoshet.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eSnapKube\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n \u003cstrong\u003e\n   A Rust 🦀 tool supports (for now) PVC snapshots across Kubernetes namespaces\n \u003c/strong\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003c!-- Github Actions --\u003e\n  \u003ca href=\"https://github.com/nikoshet/snap-kube/actions/workflows/ci.yaml?query=branch%3Amain\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/nikoshet/snap-kube/ci.yaml?branch=main\u0026style=flat-square\" alt=\"actions status\" /\u003e\u003c/a\u003e\n  \u003c!-- Version --\u003e\n  \u003ca href=\"https://crates.io/crates/snap-kube\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/v/snap-kube.svg?style=flat-square\"\n    alt=\"Crates.io version\" /\u003e\u003c/a\u003e\n  \u003c!-- Docs --\u003e\n  \u003ca href=\"https://docs.rs/snap-kube\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square\" alt=\"docs.rs docs\" /\u003e\u003c/a\u003e\n  \u003c!-- Downloads --\u003e\n  \u003ca href=\"https://crates.io/crates/snap-kube\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/d/snap-kube.svg?style=flat-square\" alt=\"Download\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n## Table of Contents\n1. [Overview](#Overview)\n2. [Modes of Operation](#modes-of-operation)\n2. [Features](#Features)\n3. [Prerequisites](#Prerequisites)\n4. [Installation](#Installation)\n    - [Client](#client)\n    - [Library](#Library)\n5. [Example](#Example)\n6. [Tested Versions](#Tested-Versions)\n7. [License](#License)\n\n## Overview\nThe SnapKube Tool is a Rust-based utility that allows Kubernetes users to backup and restore Persistent Volume Claim (PVC) snapshots. The tool provides robust mechanisms to back up data to AWS Elastic Block Store (EBS) and restore it to any Kubernetes namespace. This tool is designed to work with Kubernetes VolumeSnapshot resources, making backup and restoration operations seamless.\n\n\n## Modes of Operation\n\nThe tool supports three primary modes of operation:\n\n| Mode    | Description                                      |\n|---------|--------------------------------------------------|\n| Backup  | Create snapshots of one or more PVCs.            |\n| Restore | Restore PVCs from existing snapshots.            |\n| Full    | Run both backup and restore operations in a single process. |\n\n\n## Features\n- **Backup**: Create Kubernetes VolumeSnapshots from existing PVCs\n- **Restore**: Restore PVCs to any namespace from a VolumeSnapshot\n- **Flexible Configuration**: The user can either snapshot a specific PVC, or all the PVCs in a specific namespace using the relative flags\n- **AWS EBS Integration**: Natively supports backup and restoration to AWS Elastic Block Store\n- **Conditional Compilation**: Enable or disable specific modes (backup, restore, full) via Rust feature flags, optimizing binary size and performance.\n- **Error Handling**: Robust error handling and retries to ensure operations complete reliably\n\n## Prerequisites\nBefore using SnapKube, please ensure you have the following:\n- You need Rust installed to compile the tool. Install Rust via rustup\n- An AWS Account with the appropriate access policy\n- AWS EBS CSI Driver: Required to be installed in your Kubernetes cluster, which is a CSI Driver to manage the lifecycle of EBS Volumes\n- CSI Snapshot Controller: A snapshot-controller that supports handling the VolumeSnapshot and VolumeSnapshotContent Objects\n- A specific VolumeSnapshotClass for the CSI driver\n- Kubernetes CLI\n\n## Installation \n\n### Client\nIn order to use the tool as a client, you can use `cargo`.\n\n```\ncargo install snap-kube-client\n```\n\nThe tool provides 3 features for running it, which are `backup` `restore`, and `full` (default).\n```shell\nUsage: snap-kube-client full [OPTIONS] --source-ns \u003cSOURCE_NS\u003e --target-ns \u003cTARGET_NS\u003e --volume-snapshot-class \u003cVOLUME_SNAPSHOT_CLASS\u003e --volume-snapshot-name-prefix \u003cVOLUME_SNAPSHOT_NAME_PREFIX\u003e --target-snapshot-content-name-prefix \u003cTARGET_SNAPSHOT_CONTENT_NAME_PREFIX\u003e --storage-class-name \u003cSTORAGE_CLASS_NAME\u003e\n\nOptions:\n      --region \u003cREGION\u003e\n          Region where the EBS volumes are stored [default: eu-west-1]\n      --source-ns \u003cSOURCE_NS\u003e\n          Source namespace\n      --target-ns \u003cTARGET_NS\u003e\n          Target namespace\n      --volume-snapshot-class \u003cVOLUME_SNAPSHOT_CLASS\u003e\n          VolumeSnapshotClass name\n      --pvc-name \u003cPVC_NAME\u003e\n          PVC name [default: ]\n      --include-all-pvcs\n          Include all PVCs in the namespace\n      --volume-snapshot-name-prefix \u003cVOLUME_SNAPSHOT_NAME_PREFIX\u003e\n          VolumeSnapshot name prefix\n      --target-snapshot-content-name-prefix \u003cTARGET_SNAPSHOT_CONTENT_NAME_PREFIX\u003e\n          Target VolumeSnapshotContent name prefix\n      --storage-class-name \u003cSTORAGE_CLASS_NAME\u003e\n          StorageClass name\n      --vsc-retain-policy \u003cVSC_RETAIN_POLICY\u003e\n          VSC Retain Policy [default: delete] [possible values: retain, delete]\n  -h, --help\n          Print help\n  -V, --version\n          Print version\n```\n\n### Library\nTo install the tool as a library, you can add it to your `Cargo.toml`:\n```\ncargo add snap-kube\n```\nor\n```\n[dependencies]\nsnap-client = \"0.X\"\n```\n\nRun the tool:\n- For **full** mode:\n```\ncargo run full\n```\n\n- For **backup** mode:\n```\ncargo run --no-default-features --features backup -- backup\n```\n\n- For **restore** mode:\n```\ncargo run --no-default-features --features restore -- restore\n```\n\n## Example\n\n- Build and run the Rust tool\n```shell\ncargo fmt --all\ncargo clippy --all\ncargo nextest run --all\ncargo build\n\nRUST_LOG=info \\\n    cargo run full \\\n    --source-ns \"source-ns\" \\\n    --target-ns \"target-ns\" \\\n    --volume-snapshot-class \"volumesnapshotclass-name\" \\\n    --include-all-pvcs \\\n    --volume-snapshot-name-prefix \"prefix-vs\" \\\n    --target-snapshot-content-name-prefix \"prefix-vsc\" \\\n    --storage-class-name \"ebs-test-sc\"\n```\n\n## Tested Versions\n\n- Kubernetes v1.30\n- Rust v1.81.0\n- Amazon EBS CSI Driver v1.35.0-eksbuild.1\n- CSI Snapshot Controller: v8.0.0-eksbuild.1\n\n## License\nThis project is licensed under the MIT License \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikoshet%2Fsnap-kube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikoshet%2Fsnap-kube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikoshet%2Fsnap-kube/lists"}