How Backup your Azure Kubernetes Services ?
Yes Yes, you read correctly, it is a feature that is in preview at the time I write this article but it is possible.
Before you start:
- Currently, AKS backup supports Azure Disk-based persistent volumes (enabled by CSI driver) only. The backups are stored in operational datastore only (backup data is stored in your tenant only and isn’t moved to a vault). The Backup vault and AKS cluster should be in the same region.
- AKS backup uses a blob container and a resource group to store the backups. The blob container has the AKS cluster resources stored in it, whereas the persistent volume snapshots are stored in the resource group. The AKS cluster and the storage locations must reside in the same region.
- Currently, AKS backup supports once-a-day backup. It also supports more frequent backups (in every 4, 8, and 12 hours intervals) per day. This solution allows you to retain your data for restore for up to 360 days.
- You must install the backup extension to configure backup and restore operations on an AKS cluster.
- Ensure that
Microsoft.DataProtection, and the
TrustedAccessPreviewfeature flag on
Microsoft.ContainerServiceare registered for your subscription before initiating the backup configuration and restore operations.
Before starting, make sure that the following roles are respected:
For our test, I added in my AKS one Persistent Volume Claim cluster (PVC):
And one Persitent Volume (PV):
We can see that in Disk Azure, my disk is well created:
We will now go to our AKS cluster, backup section (Preview):
We need to install the extension:
You must first create a storage account & container, then you can click on create:
Now we wait:
After several minutes of waiting we can configure a backup:
Select your Vault, if it is requested, do not hesitate to click on Grant Permissions in Kubernetes Services:
After a few minutes of patience we move on:
I invite you to define your Backup Policy and then click on Next:
Select your datasource, in other words what you want to save:
Once this step is completed, we will validate the snapshot below:
It seems that a role is missing on my Aks Cluster, which I can add from the menu above:
after few minute all it’s ok :
Click on Next:
The backup protection is available now:
Now you know how to backup your AKS cluster, in the next article we will see how to restore the same cluster.