feat(backups): crash-consistent tenant Kubernetes backups from one group snapshot of etcd and data volumes
維護者通常 3 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- go, kubernetes
研究方向
Start with the Kubernetes backup strategy from #4931 and the etcd design in #4817; the issue does not name implementation files or tests. First resolve how etcd-operator and Kamaji will restore etcd under a live TenantControlPlane, then check support for VolumeGroupSnapshot across the platform and Velero. Done means tenant etcd member PVCs and data volumes are captured together, with the shared-etcd fallback and restore path defined.
由索引模型根據 Issue 內容生成。
描述
Problem
A backup of a tenant Kubernetes application (the Kubernetes strategy, #4931) is taken in two steps: an etcdctl dump of the cluster's prefix, then Velero CSI snapshots of its volumes. The two are seconds to minutes apart, and the volumes are not captured at the same instant as each other either.
Anything whose state spans API objects and volumes can come back inconsistent: a database or Kafka operator running inside the tenant cluster (custom resources and Secrets in etcd, data on PVCs), a PVC created or resized between the two steps, or an application spread over several volumes, such as a database and its WAL on separate PVCs. For workloads like these the restore can need manual repair today.
Proposal
Once #4817 gives each tenant cluster its own etcd on its own PVCs in the application namespace, take one CSI VolumeGroupSnapshot of the etcd member PVCs and the cluster's data volumes. It produces a crash-consistent point-in-time copy of the whole cluster, API state and data together, as if every disk lost power at the same moment. etcd recovers from that through its WAL, and the group snapshot captures all members at the same instant. linstor implements group snapshots with one suspend-IO barrier across the batch.
Worker system disks stay out of the group. Nodes are recreated by Cluster API from the image and the Talos config on restore, and a restored node disk would bring back a stale kubelet identity. The tenant's volumes live on the host DataVolumes, not on the node disks.
Prerequisites
- #4817: a cluster's own etcd. Clusters still on a shared tenant etcd keep the logical dump, because their etcd disk holds every cluster of the tenant.
- VolumeGroupSnapshot enabled in the platform: snapshot-controller v8.4 with the
v1beta1/v1beta2CRDs and theCSIVolumeGroupSnapshotgate on the controller and on the linstor csi-snapshotter, plus aVolumeGroupSnapshotClass. See https://github.com/cozystack/cozystack/pull/4931#issuecomment-6196428333. - All volumes of the group on one CSI driver and in one namespace (check the StorageClasses from
kubernetesEtcd.storageClassLocal/storageClassReplicatedagainst the data volumes). - Velero 1.17+ moves group snapshots to the bucket (volume group label on the PVCs). The linstor group snapshot itself is in-cluster only.
Open design question: restore
Restore no longer writes a logical dump. It has to bring etcd back from member disks under a live Kamaji TenantControlPlane. #4817 calls this the hard part and leaves it to its own design. Options:
- recreate the
EtcdClusteron the restored PVCs with the same member identities; - restore one member's database with
etcdutl snapshot restoreinto a new cluster.
Both need to be agreed with etcd-operator and with Kamaji's datastore binding. The in-place restore changes too: stop the control plane, replace the etcd and data volumes, start it again.
The logical dump stays as the path for clusters on a shared etcd, and as a fallback.
- 主要語言
- Go
- 星號
- 2.2k
- 分支
- 209
- 平均合併
- 4 天 14 小時
- 30 天內合併 PR
- 140
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
cozystack/cozystack 的其他 Issue
-
triage/needs-triage
難度 2/5 1-3 小時 新手友好度 78/100
cozystack/cozystack#5464 · 1 個 reaction ·
維護者通常 3 天內回覆
-
test(kubernetes-nodes): stop hand-typing the default Talos version in tests that are not about it未關閉area/testing kind/cleanup triage/needs-triage
難度 2/5 1-3 小時 新手友好度 74/100
cozystack/cozystack#5456 · 1 個 reaction ·
維護者通常 3 天內回覆
-
area/testing kind/cleanup triage/needs-triage
難度 2/5 1-3 小時 新手友好度 83/100
cozystack/cozystack#5447 · 1 個 reaction ·
維護者通常 3 天內回覆
-
area/kubernetes kind/bug triage/needs-triage
難度 2/5 1-3 小時 新手友好度 72/100
cozystack/cozystack#5445 · 1 個 reaction ·
維護者通常 3 天內回覆
-
kind/bug triage/needs-triage
難度 2/5 1-3 小時 新手友好度 74/100
cozystack/cozystack#5438 · 1 個 reaction ·
維護者通常 3 天內回覆
查看 cozystack/cozystack 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
-
Correct local module testing instructions for Go sample contributors可能已有人在做 @slievrly 今天認領。 未關閉
難度 1/5 1 小時以內 新手友好度 90/100
-
internal/core: cleanAttachmentName splits a rune at the 255-byte cap and stores invalid UTF-8可能已有人在做 @pacwestnobody 今天認領。 未關閉go good first issue help wanted
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 1 天內回覆
-
TestLaunchGolden spends about 98 seconds on fake-agent exit delays under -race可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
factory:subtask
難度 1/5 1 小時以內 新手友好度 95/100
維護者通常 1 天內回覆