Upgrade component from v2 to v3
K8up v2.0.0 and also the respective Helm chart v2.0.0 introduced breaking changes that also affect this component. The upgrade process of K8up itself is documented here: k8up.io/k8up/2.0/how-tos/upgrade.html. Contrary to the Helm chart, this component already ships the necessary CRDs.
With component version 3.0.0, a new parameter majorVersion
is introduced (with default value being v2
).
This parameter, together with multi-instantiation, enables you to deploy both K8up v1 and v2 at once.
With the CRDs having a new domain with K8up v2, it’s essentially a new operator with no direct upgrade path.
K8up Backup
, Schedule
and similar objects will have to be manually migrated from backup.appuio.ch/v1alpha1
to k8up.io/v1
before K8up v1 can be shut down.
Older Kubernetes versions < 1.16 (for example OpenShift 3.11) aren’t supported anymore in K8up v2.
While you can upgrade the component version to v3, configuring the component with |
Parameter changes
-
majorVersion
parameter is introduced with default valuev2
. -
enabled
parameter is deprecated. This parameter was used as a temporary workaround to disable a component until Commodore could do it natively. -
crd
parameter is deprecated (is only used for K8up v1). -
monitoring_kube_state_metrics_job_name_label
parameter is deprecated (is only used for K8up v1). -
images.wrestic
parameter is deprecated (is only used for K8up v1). -
Default value of
namespace
changed fromsyn-backup
tosyn-backup-k8up
. -
Default value of
charts.k8up
changed from1.x
to2.x
. -
Default value of
images.k8up.registry
changed fromquay.io
toghcr.io
. -
Default value of
images.k8up.repository
changed fromvshn/wrestic
tok8up-io/wrestic
. -
Default value of
images.wrestic.registry
changed fromquay.io
toghcr.io
. -
Default value of
images.wrestic.repository
changed fromvshn/wrestic
tok8up-io/wrestic
. -
Default value of
images.wrestic.tag
changed fromv0.3.2
tov0.3.3
. -
Default value of
monitoring_alerts.k8up_last_errors.expr
changed frombaas_backup_restic_last_errors[…]
tok8up_backup_restic_last_errors[…]
. IfmajorVersion=v1
then the previous value withbaas_backup_restic_last_errors[…]
is applied.
Library changes
If you are importing backup-k8up.libjsonnet
in other components to create K8up objects, these objects will automatically be updated to use the K8up v2 CRDs after upgrading the component to v3.x.
The following functions have been changed to create K8up v2 resources:
-
Job
-
Schedule
-
PreBackupPod
Steps to run two instances at once
The recommended upgrade path is as follows:
-
Update component version to v3.x.x
-
Configure existing component instance for K8up v1.
parameters: backup_k8up: + majorVersion: v1 (1) + namespace: syn-backup (2) + ...
1 Override default value with v1
2 The default for K8up v2 has changed, so keep the original or custom value here -
Compile and push cluster catalog. Verify that existing deployment for K8up v1 is upgraded correctly.
-
Add another instance of this component, but with K8up v2.
applications: - backup-k8up + - backup-k8up as k8up-v2 (1) parameters: backup_k8up: majorVersion: v1 namespace: syn-backup ... + k8up_v2: (1) + majorVersion: v2 (2) + namespace: syn-backup-k8up (2) + helmReleaseName: k8upv2 (2) + ... (3)
1 Use component instantiation 2 You need to explicitly override these if running both instances at once 3 Set specific settings to this instance if applicable -
Compile and push cluster catalog. Verify that existing deployment for K8up v1 is untouched. Verify that new deployment for K8up v2 is rolled out.
If you are confident in the rollout you can also combine the component instantiation in one compilation. This will already recreate K8up resources managed in other components that import backup-k8up.libjsonnet
with K8up v2 CRDs! -
Manually migrate all K8up objects from
backup.appuio.ch/v1alpha1
tok8up.io/v1
. See more details in Multiple Instances Of K8up
Steps to run after all objects are migrated to K8up v2
-
Remove K8up v2 instance
applications: - backup-k8up - - backup-k8up as k8up-v2 parameters: backup_k8up: (1) - majorVersion: v1 - namespace: syn-backup - k8up_v2: - helmReleaseName: k8upv2 (2) ... (1)
1 Move custom parameters under k8up_v2
tobackup_k8up
2 Overriding the Helm release name isn’t necessary anymore -
Compile and push cluster catalog.
-
Delete the K8up v1 CRDs
for crd in archives.backup.appuio.ch backups.backup.appuio.ch checks.backup.appuio.ch effectiveschedules.backup.appuio.ch prebackuppods.backup.appuio.ch prunes.backup.appuio.ch restores.backup.appuio.ch schedules.backup.appuio.ch snapshots.backup.appuio.ch; do kubectl delete crd "${crd}" done
This will delete all remaining K8up v1 resources!