CDI decides whether a DataVolume may adopt an existing claim from the
cdi.kubevirt.io/allowClaimAdoption annotation on the DataVolume, or
from the DataVolumeClaimAdoption feature gate. It never reads the
annotation on the PVC. The Velero modifier rule that stamped it on
every restored PVC in both the VM and the Kubernetes restore strategy
therefore changed nothing, while the Kubernetes strategy comment and
the VM restore example described it as part of what lets CDI adopt.
Drop the PVC rule from both strategies. Adoption still rests on the
annotation the vm-disk chart puts on its DataVolume and, for tenant
clusters, on the rule that sets it on restored DataVolumes, which a
test now pins as the only rule of the volumes phase.
Without that rule an in-place VM strategy restore of a VMDisk, or of
a VMInstance with no recorded IP and MAC to keep, has no modifier rule
left. Velero fails validation of a Restore whose modifier ConfigMap
has an empty rule list, so in that case no ConfigMap is created and
the Restore carries no resource modifier.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
A tenant Kubernetes application had no backup route in cozy-default, and
none of the existing strategies fits it. Its API state is a key prefix in
the etcd DataStore the whole tenant shares, so the Etcd strategy's snapshot
would roll every tenant cluster back at once; its control-plane CA, service
account key and Talos secrets cannot be regenerated without breaking every
node and credential issued under them; and its PersistentVolumes are
DataVolumes in the tenant namespace that the application's own deletion
removes.
The new Kubernetes strategy backs up the cluster's etcd prefix with a Job
that authenticates with the cluster's own datastore certificate, and the PKI
Secrets and data DataVolumes with Velero. The HelmReleases of the cluster
and its node pools are recorded on the Backup rather than in Velero,
because a label selector for them would also pick up the worker system
disks. A backup warns when a CA would expire before the backup does.
A restore rebuilds a deleted cluster under its old CA, or rolls a live one
back after stopping its control plane and workers, and lets the etcd
prefix and the volumes be restored separately.
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
Assisted-by: LLM