|
| 1 | +# kubesnap |
| 2 | + |
| 3 | +> Take consistent Kubernetes snapshots of cluster resources and push them to object storage. |
| 4 | +
|
| 5 | +[](./.github/workflows/build.yml) |
| 6 | +[](./.github/workflows/deploy.yml) |
| 7 | + |
| 8 | +--- |
| 9 | + |
| 10 | +## Overview |
| 11 | + |
| 12 | +**kubesnap** is a lightweight microservice designed to capture **snapshots of Kubernetes workloads** (pods, jobs, cronjobs, deployments, and services) and push them into an object storage bucket for archival, compliance, and debugging purposes. |
| 13 | + |
| 14 | +It integrates smoothly with Kubernetes clusters and can be deployed as a containerized service with proper RBAC and API access. |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## Features |
| 19 | + |
| 20 | +- Collects runtime information of **pods, jobs, cronjobs, deployments, services** |
| 21 | +- Pushes snapshot data to **Object Storage** (OCI or any S3-compatible backend) |
| 22 | +- Supports **scheduled snapshots** via CronJobs |
| 23 | +- Secured with **Kubernetes RBAC** and service accounts |
| 24 | +- Delivered as a **Docker container** and easily deployed on any Kubernetes cluster |
| 25 | +- GitHub Actions workflows for **CI/CD** (build & deploy pipelines) |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +## 📂 Project Structure |
| 30 | + |
| 31 | +kubesnap/ |
| 32 | +├── deploy_project.sh # Deployment helper script |
| 33 | +├── dockerfiles/ |
| 34 | +│ └── Dockerfile.kubesnap # Container build file |
| 35 | +├── kubernetes/ |
| 36 | +│ ├── deployments/ |
| 37 | +│ │ └── kubesnap-deployment.yaml |
| 38 | +│ ├── rbac/ |
| 39 | +│ │ ├── kubesnap-svc-acc.yaml |
| 40 | +│ │ ├── role-binding.yaml |
| 41 | +│ │ └── svc-acc-cluster-role.yaml |
| 42 | +│ └── services/ |
| 43 | +│ ├── kubesnap-svc.yaml |
| 44 | +│ └── kubesnap-ingress.yaml |
| 45 | +├── src/ |
| 46 | +│ ├── api/ |
| 47 | +│ │ └── kubesnap.py # API entrypoint |
| 48 | +│ └── core/ |
| 49 | +│ └── kubesnap_functions.py# Core logic for snapshots |
| 50 | +└── .github/workflows/ |
| 51 | +├── build.yml # CI build workflow |
| 52 | +└── deploy.yml # CD deployment workflow |
| 53 | + |
| 54 | +# Installation |
| 55 | + |
| 56 | +- Clone the repository |
| 57 | +- Enter the kubesnap repository |
| 58 | +- In case you want to deploy kubesnap to a custom namespace, run the command |
| 59 | + `export NAMESPACE="<CUSTOM-NAMESPACE>"` |
| 60 | +- Give execute permissions to the file |
| 61 | + `chmod +x deploy_project.sh` |
| 62 | +- Run the file |
| 63 | + `./deploy_project.sh` |
0 commit comments