add size parameters and validate the backed up data stored in s3 bucket

closes #3762 (closed) #3761 (closed)

this MR

  • Verify the uploaded object size matches the actual tar size
  • adds the following metrics to the Prometheus alerts
    • backup_size_bytes -> indicating the amount of size of the backup
    • backup_size_integrity -> 1 if size of the actual tar created and uploaded to s3 bucket are same else 0

and it checks the tar created

output of the script:

for capi resources

-- Start backing up clusters from namespace 'sylva-system'.
Moving to directory...
Discovering Cluster API objects
Starting move of Cluster API objects Clusters=1
Moving Cluster API objects ClusterClasses=0
Saving files to /tmp/tmp.kHEHGA/sylva-system_capi_resources_backup_202603250545
-- Backing up additional resources : ConfigMap/sylva-units-values Secret/sylva-units-secrets ConfigMap/capo-cluster-resources
-- Cluster backed up.
-- Backup compressed (size: 55879 bytes).
Added `backup` successfully.
`/tmp/tmp.miKKDi` -> `backup/sylva-backup/sylva-system_capi_resources_backup_202603250545.tar.gz`
Total: 54.57 KiB, Transferred: 54.57 KiB, Speed: 25.43 KiB/s
-- Backup uploaded
-- Size integrity check passed: actual size=55879 bytes, s3 size uploaded=55879 bytes
BACKUP_ARCHIVE_SIZE_BYTES 55879
BACKUP_SIZE_INTEGRITY 1
Backup succeeded in 125 seconds (size: 55879 bytes)
-- Push result to the pushgateway

Backup summary:
    1 Succeeded: sylva-system
    0 Failed   :

for etcd

Snapshot saved at /tmp/tmp.LEkien/backup-restore_etcd_backup_202603260515/backup-restore_etcd_snapshot.db
-- Etcd backed up.
-- Backup compressed.
-- Backup compressed (size: 20986852 bytes).
Added `backup` successfully.
`/tmp/tmp.beiIpf` -> `backup/sylva-backup/backup-restore_etcd_backup_202603260515.tar.gz`
Total: 20.01 MiB, Transferred: 20.01 MiB, Speed: 149.30 MiB/s
-- Backup uploaded
-- Size integrity check passed: actual size=20986852 bytes, s3 size uploaded=20986852 bytes
BACKUP_ARCHIVE_SIZE_BYTES 20986852
BACKUP_SIZE_INTEGRITY 1
Backup succeeded in 6 seconds
-- Push result to the pushgateway

CI configuration

Below you can choose test deployment variants to run in this MR's CI.

Click to open to CI configuration

Legend:

Icon Meaning Available values
☁️ Infra Provider capd, capo, capm3
🚀 Bootstrap Provider kubeadm (alias kadm), rke2, okd, ck8s
🐧 Node OS ubuntu, suse, na, leapmicro
🛠️ Deployment Options Deployment option list and description
🎬 Pipeline Scenarios Available scenario list and description
🟢 Enabled units Any available units name, by default apply to management and workload cluster. Can be prefixed by mgmt: or wkld: to be applied only to a specific cluster type
🔴 Disabled units Any available units name, by default apply to management and workload cluster. Can be prefixed by mgmt: or wkld: to be applied only to a specific cluster type
🏗️ Target platform Can be used to select specific deployment environment (i.e real-bmh for capm3 )
  • 🎬 preview ☁️ capd 🚀 kadm 🐧 ubuntu

  • 🎬 preview ☁️ capo 🚀 rke2 🐧 suse

  • 🎬 preview ☁️ capm3 🚀 rke2 🐧 ubuntu

  • ☁️ capd 🚀 kadm 🛠️ light-deploy 🐧 ubuntu

  • ☁️ capd 🚀 rke2 🛠️ light-deploy 🐧 suse

  • ☁️ capo 🚀 rke2 🛠️ backup 🐧 suse

  • ☁️ capo 🚀 rke2 🐧 leapmicro

  • ☁️ capo 🚀 kadm 🛠️ backup 🐧 ubuntu

  • ☁️ capo 🚀 kadm 🐧 ubuntu 🟢 neuvector,mgmt:harbor

  • ☁️ capo 🚀 rke2 🎬 rolling-update 🛠️ ha 🐧 ubuntu

  • ☁️ capo 🚀 kadm 🎬 wkld-k8s-upgrade 🐧 ubuntu

  • ☁️ capo 🚀 rke2 🎬 rolling-update-no-wkld 🛠️ ha 🐧 suse

  • ☁️ capo 🚀 rke2 🎬 sylva-upgrade 🛠️ ha 🐧 ubuntu

  • ☁️ capo 🚀 rke2 🎬 sylva-upgrade-from-1.6.x 🛠️ ha,misc 🐧 ubuntu

  • ☁️ capo 🚀 rke2 🛠️ ha,misc 🐧 ubuntu

  • ☁️ capo 🚀 rke2 🛠️ misc 🐧 ubuntu 🟢 mgmt:harbor 🔴 neuvector

  • ☁️ capo 🚀 rke2 🛠️ ha,misc,openbao🐧 suse

  • ☁️ capo 🚀 rke2 🐧 suse 🎬 upgrade-from-prev-tag

  • ☁️ capm3 🚀 rke2 🛠️ backup 🐧 suse

  • ☁️ capm3 🚀 kadm 🛠️ backup 🐧 ubuntu

  • ☁️ capm3 🚀 ck8s 🐧 ubuntu

  • ☁️ capm3 🚀 kadm 🎬 rolling-update-no-wkld 🛠️ ha,misc 🐧 ubuntu

  • ☁️ capm3 🚀 rke2 🎬 wkld-k8s-upgrade 🛠️ ha 🐧 suse

  • ☁️ capm3 🚀 kadm 🎬 rolling-update 🛠️ ha 🐧 ubuntu

  • ☁️ capm3 🚀 rke2 🎬 upgrade-from-prev-release-branch 🛠️ ha 🐧 suse

  • ☁️ capm3 🚀 rke2 🛠️ misc,ha 🐧 suse

  • ☁️ capm3 🚀 rke2 🎬 sylva-upgrade 🛠️ ha,misc 🐧 suse

  • ☁️ capm3 🚀 kadm 🎬 rolling-update 🛠️ ha 🐧 suse

  • ☁️ capm3 🚀 ck8s 🎬 rolling-update 🛠️ ha 🐧 ubuntu

  • ☁️ capm3 🚀 rke2|okd 🎬 no-update 🐧 ubuntu|na

  • ☁️ capm3 🚀 rke2 🐧 suse 🎬 upgrade-from-release-1.5

  • ☁️ capm3 🚀 rke2 🐧 suse 🎬 upgrade-to-main

Global config for deployment pipelines

  • autorun pipelines
  • allow failure on pipelines
  • record sylvactl events

Notes:

  • Enabling autorun will make deployment pipelines to be run automatically without human interaction
  • Disabling allow failure will make deployment pipelines mandatory for pipeline success.
  • if both autorun and allow failure are disabled, deployment pipelines will need manual triggering but will be blocking the pipeline

Be aware: after configuration change, pipeline is not triggered automatically. Please run it manually (by clicking the run pipeline button in Pipelines tab) or push new code.

Edited by Thomas Morin

Merge request reports

Loading
Loading