{"id":17272213,"url":"https://github.com/eumel8/vcluster-backup","last_synced_at":"2026-05-15T18:34:56.225Z","repository":{"id":224781727,"uuid":"764183127","full_name":"eumel8/vcluster-backup","owner":"eumel8","description":"A tool to backup your sqlite database in S3","archived":false,"fork":false,"pushed_at":"2026-03-10T07:15:37.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-10T15:00:26.427Z","etag":null,"topics":["k3s","sqlite","vcluster"],"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/eumel8.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-27T16:18:01.000Z","updated_at":"2026-03-10T07:15:38.000Z","dependencies_parsed_at":"2024-08-19T14:54:04.548Z","dependency_job_id":"986fdc18-e722-44f2-a8a7-f9f3bbbc61cb","html_url":"https://github.com/eumel8/vcluster-backup","commit_stats":null,"previous_names":["eumel8/vcluster-backup"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/eumel8/vcluster-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eumel8%2Fvcluster-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eumel8%2Fvcluster-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eumel8%2Fvcluster-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eumel8%2Fvcluster-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eumel8","download_url":"https://codeload.github.com/eumel8/vcluster-backup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eumel8%2Fvcluster-backup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33074876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["k3s","sqlite","vcluster"],"created_at":"2024-10-15T08:48:07.492Z","updated_at":"2026-05-15T18:34:56.209Z","avatar_url":"https://github.com/eumel8.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vcluster backup\n\nA tool to backup periodically your sqlite DB from K3S/vCluster to S3 storage.\n\n## Prerequisites\n\n- [vCluster](https://www.vcluster.com/docs/getting-started/deployment) deployed in non-HA with K3S and embedded sqlite DB\n- S3 compatible storage, using [Minio with security fixes](https://github.com/eumel8/minio/tree/fix/securitycontext/helm/minio)\n\n## Usage\n\nOn a single Kubernetes cluster build with vCluster and K3S there is no mechanism included to backup your cluster or your backend database. Of course, there are hints to use RDS or etcd, in our use case we have the embedded sqlite, which is in fact one file what we want to backup securely and periodically. \n\n\n```bash\n$ ./vcluster-backup -h\nUsage of ./vcluster-backup:\n  -accessKey string\n    \tS3 accesskey.\n  -backupFile string\n    \tSqlite database of K3S instance. (default \"/data/server/db/state.db\")\n  -backupInterval int\n    \tInterval in minutes for backup. (default 2)\n  -bucketName string\n    \tS3 bucket name. (default \"k3s-backup\")\n  -decrypt\n    \tDecrypt the file\n  -encKey string\n    \tS3 encryption key.\n  -endpoint string\n    \tS3 endpoint.\n  -list\n    \tList S3 objects\n  -region string\n    \tS3 region. (default \"default\")\n  -secretKey string\n    \tS3 secretkey.\n  -trace string\n    \tTrace S3 API calls\n  -insecure string\n    \tInsecure S3 backend\n\n```\n\nstart backup:\n\n```bash\n$ ./vcluster-backup -accessKey vclusterbackup99 -bucketName vclusterbackup99 -endpoint minio.example.com -secretKey xxxxxx -encKey 12345 -backupInterval 1\n# TODO: we need the /data/server/token?\n```\n\nlist backups:\n\n```bash\n$ ./vcluster-backup -accessKey vclusterbackup99 -bucketName vclusterbackup99 -endpoint minio.example.com -secretKey xxxxxx -list\nListing S3 objects in bucket  vclusterbackup99\nObject: backup_20240304143145.db.enc\nObject: backup_20240304143245.db.enc\nObject: backup_20240304143345.db.enc\nObject: backup_20240304144757.db.enc\nObject: backup_20240304144858.db.enc\nObject: backup_20240304150748.db.enc\nObject: backup_20240304150848.db.enc\n```\n\nrestore backup:\n\n```bash\n# stop k3s server\nrm -rf /data/server/*\nmkdir -p /data/server/db\n./vcluster-backup -accessKey vclusterbackup99 -bucketName vclusterbackup99 -endpoint minio.example.com -secretKey xxxxxx -backupFile backup_20240304143345.db.enc -encKey 12345 -restore\ncp backup_20240304143345.db.enc-restore /data/server/db/state.db\n# start k3s server\n```\n\n\n## Integration in vcluster setup\n\nFrom the idea vcluster-backup is used as sidecar container to the vcluster statefulset. The [origin Helm chart](https://github.com/loft-sh/vcluster/blob/v0.19.3/charts/k3s/templates/syncer.yaml) doesn't support sidecar container. There is a special version with this feature which can be used with this sidecar-values.yaml:\n\nexample with env vars and existing secret (prefered method)\n\n\u003cdetails\u003e\n  \n```yaml\nsidecar:\n- env:\n    - name: ENDPOINT\n      value: minio.example.com\n    - name: ACCESS_KEY\n      value: vc1\n    - name: BUCKET_NAME\n      value: vc1\n    - name: CLUSTERNAME\n      value: vc1\n    - name: ENC_KEY\n      value: \"12345\"\n    - name: TRACE\n      value: \"1\"\n    - name: INSECURE\n      value: \"1\"\n    - name: BACKUP_INTERVAL\n      value: \"1\"\n    - name: SECRET_KEY\n      valueFrom:\n        secretKeyRef:\n          name: s3-register\n          key: s3secretkey\n  image: mtr.devops.telekom.de/caas/vcluster-backup:latest\n  imagePullPolicy: Always\n  name: backup\n  resources:\n    limits:\n      cpu: \"1\"\n      memory: 512Mi\n    requests:\n      cpu: 20m\n      memory: 64Mi\n  securityContext:\n    allowPrivilegeEscalation: false\n    capabilities:\n      drop:\n      - all\n    readOnlyRootFilesystem: true\n    runAsGroup: 1000\n    runAsNonRoot: true\n    runAsUser: 1000\n  volumeMounts:\n  - mountPath: /tmp\n    name: tmp\n  - mountPath: /data\n    name: data\n```\n\n\u003c/details\u003e\n\nexample with program flags\n\n\u003cdetails\u003e\n\n```yaml\nsidecar:\n  - args:\n    - /app/vcluster-backup\n    - -endpoint=minio.example.com\n    - -accessKey=xxxxx\n    - -secretKey=xxxxx\n    - -bucketName=vclusterbackups\n    - -encKey=12345 \n    - -trace=\"1\"\n    - -insecure=\"1\"\n    image: mtr.devops.telekom.de/caas/vcluster-backup:latest\n    imagePullPolicy: Always\n    name: backup\n    resources:\n      limits:\n        cpu: \"1\"\n        memory: 512Mi\n      requests:\n        cpu: 20m\n        memory: 64Mi\n    securityContext:\n      allowPrivilegeEscalation: false\n      capabilities:\n        drop:\n        - all\n      readOnlyRootFilesystem: true\n      runAsGroup: 1000\n      runAsNonRoot: true\n      runAsUser: 1000\n    volumeMounts:\n    - mountPath: /tmp\n      name: tmp\n    - mountPath: /data\n      name: data\n```\n\n\u003c/details\u003e\n\n```bash\n$ helm -n vc1 upgrade -i vc1 -f sidecar-value.yaml --version v0.19.3 oci://mtr.devops.telekom.de/caas/charts/vcluster\n```\n\n## build\n\n```bash\n$ go mod tidy\n$ CGO_ENABLED=0 go build -o vcluster-backup vcluster-backup.go\n```\n\n## Credits\n\n- Frank Kloeker \u003cf.kloeker@telekom.de\u003e\n\nLife is for sharing. If you have an issue with the code or want to improve it, feel free to open an issue or an pull\nrequest.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feumel8%2Fvcluster-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feumel8%2Fvcluster-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feumel8%2Fvcluster-backup/lists"}