Backup
AKS backup tricks.
AKS backup with velero
Install velero
Set env vars.
# Velero Azure Storace Account Name (must be unique)
VELERO_SA_NAME="myaksbackup"
# Velero Azure Storace Account Resource Group
VELERO_RG="rg-aks-backup"
# Velero Azure Storace Account Region
VELERO_REGION="eastus"
# Velero Azure Storace Account Subscription
VELERO_SUBSCRIPTION="MY-SUBSCRIPTION"Create Velero Storage Account Resource Group.
az group create \
--location $VELERO_REGION \
--name $VELERO_RG \
--subscription $VELERO_SUBSCRIPTION \
--tags 'ENV=DEV' 'BU=MARKETING'Create Velero Storage Account.
Create BLOB.
Create Velero Service Principal.
Copy and paste in a safe place the Service Principal credentials.
Velero Service Principal must be owner of the AKS Node Resource Group.
Velero Service Principal must be owner of the Storage Account RG.
Set env vars.
Create a file with Velero credentials.
Install Velero.
Restic
Requirements
Your pods must have the following annotation.
To backup azure-file, the Storage Classes must have the following mount option:
For more details search for "Microsoft Azure" here: https://velero.io/docs/master/restic/
Credentials
List restic repos
Get restic password
List snapshots
Mount volume
Force delete
References
https://docs.syseleven.de/metakube/en/tutorials/create-backup-and-restore
https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#microsoft-azure-blob-storage
https://restic.readthedocs.io/en/latest/060_forget.html
Backup test
Apply the following manifest.
Create a test backup.
References
https://github.com/vmware-tanzu/velero-plugin-for-microsoft-azure
https://velero.io/docs/v1.3.2/restic/ Search for "Microsoft Azure"
https://stackoverflow.com/questions/61915527/azure-aks-backup-using-velero
https://github.com/vmware-tanzu/velero/issues/1404
https://github.com/vmware-tanzu/velero-plugin-for-microsoft-azure/issues/13
Velero (DEPRECATED DOCUMENTATION)
Setup the storage
Velero stores the backup files on a Storage Account.
Using Azure CLI, login and set your subscription.
Define variables.
Create the Storage Account.
Create the Storage Container.
Create a Service Principal.
Get the output and save it in a secure place (it will be displayed only once).
Create the Velero credentials file.
Install Velero
First of all, make sure you have kubectl.
Check the latest Velero release: https://github.com/heptio/velero/releases
Install it.
Deploy it.
Test it
References
https://github.com/vmware-tanzu/velero-plugin-for-microsoft-azure
https://velero.io/docs/v1.0.0/azure-config/
https://blog.getupcloud.com/velero-backup-do-seu-cluster-kubernetes-em-5-minutos-3129a0518541
Backup schedule
Last updated