projectsyn / component-cluster-backup

This is a Commodore Component for managing backups of a cluster
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Upgrade to k8up 2.x causes backup.appuio.ch/v1alpha1 can't be pruned #28

Closed megian closed 2 years ago

megian commented 2 years ago

After upgrading k8up to >= 2.0 ArgoCD (Component version >= v3.0.0) stuck pruning the old backup.appuio.ch schedules. It looks like k8up 2.0 doesn't react on the finalizer of those objects. Workaround of manually removing the finalizer does work.

Steps to Reproduce the Problem

  1. Have a cluster with k8up 1.2 and cluster-backup
  2. Upgrade k8up to component version >= v3.0.0
  3. Check ArgoCD

Actual Behavior

  1. The k8up 1.x schedule.backup.appuio.ch schedules schedules

Expected Behavior

  1. K8up upgrade 2.x do not require a manual interaction or at least an upgrade procedure is documented

Workaround

It currently is working to just remove the finalizer k8up.syn.tools/schedule. The new schedule objects are created automatically.

oc patch -n syn-cluster-backup schedule.backup.appuio.ch objects --type=json --patch='[{"op":"remove", "path": "/metadata/finalizers"}]'
oc patch -n syn-cluster-backup-etcd schedule.backup.appuio.ch etcd --type=json --patch='[{"op":"remove", "path": "/metadata/finalizers"}]'
ccremer commented 2 years ago

Did you follow the steps as described in https://hub.syn.tools/backup-k8up/how-tos/upgrade-v2-v3.html#_steps_to_run_two_instances_at_once? It's required to have K8up v1 and v2 running at the same time in order for old schedules to be removed due to the Finalizer. K8up v2 doesn't handle the finalizers of Schedules made for K8up v1.

ccremer commented 2 years ago

least an upgrade procedure is documented

Is the upgrade documentation insufficient? Please open an issue in https://github.com/projectsyn/component-backup-k8up/ if you feel something's missing.

megian commented 2 years ago

You are right. It was a new cluster and I did do an in-pace upgrade rather than having k8up parallel in different versions. It's unusual, that APIs are just replaced, usually they are deprecated first. Going to close this as it is high likely not the case, if the upgrade procedure is considered correctly.