{"id":26821158,"url":"https://github.com/rogosprojects/kbak","last_synced_at":"2025-07-06T20:37:19.452Z","repository":{"id":280354905,"uuid":"941715536","full_name":"rogosprojects/kbak","owner":"rogosprojects","description":"Kubernetes Manifest Backup Tool","archived":false,"fork":false,"pushed_at":"2025-03-28T20:15:35.000Z","size":165,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T21:22:39.266Z","etag":null,"topics":["golang","kubernetes","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rogosprojects.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2025-03-02T23:13:21.000Z","updated_at":"2025-03-28T20:15:38.000Z","dependencies_parsed_at":"2025-03-28T21:21:40.372Z","dependency_job_id":"c3185643-cc31-4fc1-aab7-ff48d80ec1ef","html_url":"https://github.com/rogosprojects/kbak","commit_stats":null,"previous_names":["rogosprojects/kbak"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogosprojects%2Fkbak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogosprojects%2Fkbak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogosprojects%2Fkbak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogosprojects%2Fkbak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rogosprojects","download_url":"https://codeload.github.com/rogosprojects/kbak/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250568401,"owners_count":21451613,"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":["golang","kubernetes","yaml"],"created_at":"2025-03-30T07:18:28.898Z","updated_at":"2025-04-24T05:24:52.625Z","avatar_url":"https://github.com/rogosprojects.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Project Logo](/assets/logo.jpg)\n# kbak - Kubernetes Manifest Backup Tool\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/rogosprojects/kbak?)](https://goreportcard.com/report/github.com/rogosprojects/kbak)\n[![GitHub release](https://img.shields.io/github/release/rogosprojects/kbak.svg)](https://github.com/rogosprojects/kbak/releases/latest)\n\nA Go application that backs up Kubernetes resources from a specified namespace by exporting YAML manifests, organized by resource kind.\n\n## Use Cases\n\n- **Disaster Recovery**: Create point-in-time snapshots of your Kubernetes resources for quick restoration in case of accidental deletions or cluster failures.\n- **Environment Migration**: Export manifests from one environment (e.g., staging) for deployment in another environment (e.g., production) with necessary modifications.\n- **Version Control**: Store your Kubernetes configurations in version control to track changes and maintain configuration history over time.\n- **Auditing and Compliance**: Generate snapshots of your cluster state for auditing purposes and compliance requirements.\n\n## Features\n\n- Exports all standard Kubernetes resources from a namespace or all namespaces\n- Uses the current namespace from kubeconfig when no namespace is specified\n- Organizes backups by resource kind in separate directories\n- Thoroughly cleans manifests by removing server-side and cluster-specific fields\n- Timestamp-based backup directories\n- Colorful and descriptive console output with emojis\n- Resource type filtering for selective backups\n\n## Installation\n\n### From binaries\n\nSimply download [latest binaries](https://github.com/rogosprojects/kbak/releases/latest).\n\n### Building from source\n```bash\ngo install github.com/rogosprojects/kbak/cmd/kbak@latest\n```\nor\n\n```bash\n# Clone the repository\ngit clone https://github.com/rogosprojects/kbak.git \u0026\u0026 cd kbak\n\n# Build the application\ngo build -o kbak ./cmd/kbak\n\n# Optional: install system-wide (may require sudo)\nsudo cp kbak /usr/local/bin/\n```\n#### Using Docker\n\n```bash\n# Build the Docker image\ndocker build -t kbak:latest .\n\n# Run with your kubeconfig mounted\ndocker run --rm -v ~/.kube:/root/.kube -v $(pwd)/backups:/backups kbak:latest --namespace your-namespace\n```\n\n## Usage\n\n```bash\n# Show version information\n./kbak --version\n\n# Backup resources from your current namespace (from kubeconfig)\n./kbak\n\n# Backup a specific namespace\n./kbak --namespace your-namespace\n\n# Backup all namespaces\n./kbak --all-namespaces\n\n# Specify a custom kubeconfig file\n./kbak --namespace your-namespace --kubeconfig /path/to/kubeconfig\n\n# Specify a custom output directory\n./kbak --namespace your-namespace --output /path/to/backup/dir\n\n# Backup only specific resource types (e.g., only ConfigMaps and Secrets)\n./kbak --namespace your-namespace --configmap --secret --all-resources=false\n\n# Backup only pods and deployments\n./kbak --namespace your-namespace --pod --deployment --all-resources=false\n\n# Backup resources with verbose output\n./kbak --namespace your-namespace --verbose\n```\n\n### Resource Type Filtering\n\nYou can selectively backup specific resource types using these flags:\n\n```\n--all-resources   Backup all resource types (default: true)\n--pod             Backup only pods\n--deployment      Backup only deployments\n--service         Backup only services\n--configmap       Backup only configmaps\n--secret          Backup only secrets\n--pvc             Backup only persistent volume claims\n--serviceaccount  Backup only service accounts\n--statefulset     Backup only statefulsets\n--daemonset       Backup only daemonsets\n--ingress         Backup only ingresses\n--role            Backup only roles\n--rolebinding     Backup only rolebindings\n--cronjob         Backup only cronjobs\n--job             Backup only jobs\n```\n\nWhen using resource type flags, set `--all-resources=false` to backup only the specified types.\n\n\n## Supported Resources\n\nThe tool automatically backs up the following resource types:\n\n- Core resources: Pods, Services, ConfigMaps, Secrets, PersistentVolumeClaims, ServiceAccounts\n- Apps resources: Deployments, StatefulSets, DaemonSets\n- Networking resources: Ingresses\n- Batch resources: Jobs, CronJobs\n- RBAC resources: Roles, RoleBindings\n\n## Output Structure\n\n### Single Namespace Backup\n```\n02Jan2006-15:04/\n└── namespace/\n    ├── Pod/\n    │   ├── my-pod.yaml\n    │   └── ...\n    ├── Deployment/\n    │   ├── my-deployment.yaml\n    │   └── ...\n    ├── Service/\n    │   ├── my-service.yaml\n    │   └── ...\n    └── ...\n```\n\n### All Namespaces Backup\n```\n02Jan2006-15:04/\n└── all-namespaces/\n    ├── namespace1/\n    │   ├── Pod/\n    │   │   ├── my-pod.yaml\n    │   │   └── ...\n    │   ├── Deployment/\n    │   │   └── ...\n    │   └── ...\n    ├── namespace2/\n    │   ├── Pod/\n    │   │   └── ...\n    │   └── ...\n    └── ...\n```\n## License\n\nMIT License","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogosprojects%2Fkbak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frogosprojects%2Fkbak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogosprojects%2Fkbak/lists"}