feat(backups): crash-consistent tenant Kubernetes backups from one group snapshot of etcd and data volumes

Aperta
#5,342 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, kubernetes

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

triage/needs-triage

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/v1beta2 CRDs and the CSIVolumeGroupSnapshot gate on the controller and on the linstor csi-snapshotter, plus a VolumeGroupSnapshotClass. 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 / storageClassReplicated against 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 EtcdCluster on the restored PVCs with the same member identities;
  • restore one member's database with etcdutl snapshot restore into 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.

Lingua principale
Go
Stelle
2.2k
Fork
209
Merge medio
4g 14h
PR unite (30g)
140

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cozystack/cozystack

Tutte le issue di cozystack/cozystack

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.