Skip to content

Cloud and Kubernetes Backup & Recovery: Azure Backup and Velero

Interactive Diagram

새 탭 ↗

Recovery objectives and responsibility boundaries must be defined first to combine Cloud resource backup with Kubernetes resource/PV backup appropriately.

In a cloud infra environment, backup is about far more than just preserving data; it’s a core piece of service continuity, disaster recovery, security threat response, and regulatory compliance.

  • Data protection: a safety net against unexpected deletion, corruption, or ransomware attacks
  • Service recovery: minimizing downtime through fast recovery after a system failure or disaster
  • Compliance: meeting data retention and audit requirements from industry regulations
  • Operational efficiency: automated backup/recovery processes reduce management overhead

Azure Backup service types and capabilities

Section titled “Azure Backup service types and capabilities”

Recovery Services Vault (RSV)

A traditional backup and disaster recovery solution offering broad protection across many workloads.

  • Supports: Azure Virtual Machines (Windows/Linux), Azure Files, in-VM workloads like SQL Server/SAP HANA, and on-prem servers/workloads (System Center DPM, Azure Backup Server, etc.)
  • Key features: long-term retention and recovery-point management, disaster recovery integrated with Azure Site Recovery, security features like Soft Delete and MFA, centralized monitoring in the Azure Portal
  • Use cases: enterprise environments needing complex workload protection, hybrid on-prem-to-cloud backup/recovery scenarios

Backup Vault

A newer backup solution offering simplified backup management for specific Azure workloads.

  • Supports: Azure Database for PostgreSQL, Azure Blob Storage, and other Azure services planned for future support
  • Key features: easy management via integration with Azure Backup Center, RBAC-based access control/data isolation, flexible storage options like GRS/LRS
  • Use cases: backing up specific Azure services, smaller environments with simple backup needs
ItemRecovery Services Vault (RSV)Backup Vault
PurposeBackup + disaster recovery (DR), can integrate with Azure Site RecoveryBackup management optimized for Azure-native workloads (VM, DB)
Supported workloadsAzure VM, SQL Server, SAP HANA, Azure File Share, on-prem data protectionNewer workloads like Azure Blob, Azure Database for PostgreSQL
ComplexityRelatively complex setup/management due to advanced featuresSimple setup and management, fits Azure-native backups
Disaster recoveryCross-region replication/failover via Azure Site RecoveryNo built-in disaster recovery
Storage optionsSupports long-term retention/compliance needsShort-cycle operational backups, snapshot-based storage

Backup in a Kubernetes environment needs to focus on two things: the resources that define cluster state (Deployment, ConfigMap, Secret, etc.) and application data (data stored in persistent volumes).

Comparing Kubernetes resource backup methods

Section titled “Comparing Kubernetes resource backup methods”
CategoryResource manifest backupetcd snapshot backupDedicated backup tools
Key pointsExport manifest files and store them in a version control system like GitTake a snapshot of etcd, which holds all cluster state, via a CLI commandVelero (backup/restore of cluster resources and persistent volumes), Kasten K10 (enterprise-grade, application-centric backup), Portworx PX-Backup (cloud-native backup)
ProsVersion control/change tracking, human-readable, easy to apply even to managed K8s servicesContains all cluster resource information, fast to restoreUnified resource + volume backup management, automation/scheduling, supports cross-cloud migration
ConsMay not capture all of the cluster’s dynamic state, management gets complex at large scaleManaged K8s (AKS, EKS, GKE, etc.) restrict direct etcd access; time-consuming at scaleExtra resource/management overhead, some tools are paid

Azure Kubernetes Service (AKS) backup solutions

Section titled “Azure Kubernetes Service (AKS) backup solutions”

Azure Backup for AKS

  • Key features: backs up every Kubernetes resource in a namespace (Deployment, Service, ConfigMap, etc.), consistent backup of persistent volumes on Azure Disk/Files, central management through the Azure Portal, granular restore at the level of a whole cluster, a specific namespace, or an individual resource
  • Setup: create a Backup Vault in the Azure Portal, select the target AKS cluster and configure a backup policy, set up roles/permissions, define a backup schedule and retention policy
  • Pros: tight integration with Azure services, supports migration/disaster-recovery scenarios, multi-region backup options

Velero with Azure Blob Storage

  • Setup: create an Azure Blob Storage account/container, install Velero on the AKS cluster via Velero CLI or a Helm chart, configure Azure storage credentials, define a backup schedule and retention policy
  • Key features: backs up Kubernetes resources and persistent volumes, scheduled automated backups, selective resource backup/restore, supports cross-cluster migration
  • Pros: open-source flexibility, portable across cloud environments, highly customizable

Reference: AKS backup: Velero + MinIO (Helm-based)

Section titled “Reference: AKS backup: Velero + MinIO (Helm-based)”

Installing Velero on Azure via Helm can sometimes fail due to Object Storage permission issues, in which case you can stand up MinIO as separate backup storage instead of Azure Blob Storage and integrate it that way. We set this up mainly as a learning exercise to avoid CLI-based configuration; for a real deployment we’d recommend using the Azure Backup service in a cloud-native way, or using Object Storage directly as the storage location. In particular, MinIO has limits on storage scaling that hurt availability, and because it backs up file-by-file rather than at the block level, it can underperform compared to block-based backup.

Backup architecture

Setup

MinIO can run in two modes by default (standalone, distributed); a distributed setup is needed for high availability. Standalone is fine for dev/test. Set a dedicated rootUser/rootPassword, you’ll need it both to log into the MinIO web UI and to create the secret when configuring Velero.

## minio mode, i.e. standalone or distributed
mode: standalone
## rootUser, rootPassword
## rootUser and rootPassword is generated when not set
rootUser: xxxxx
rootPassword: xxxxxxx
persistence:
enabled: true
storageClass: ""
volumeName: ""
accessMode: ReadWriteOnce
size: 500Gi

Before deploying Velero via Helm, you need to configure it to talk to MinIO: MinIO is integrated over the S3 API, so the provider must be set to AWS rather than Azure. Declare backupStorageLocation as default where possible, to avoid errors from an unspecified storage-location when creating a Velero backup. The secret for MinIO integration is the user/password created when setting up MinIO, formatted as AWS config.

configuration:
backupStorageLocation:
- name: minio-backup
provider: aws
bucket: velero
default: "true"
config:
region: minio
s3ForcePathStyle: "true"
s3Url: http://minio.minio.svc.cluster.local:9000
publicUrl: http://minio.minio.svc.cluster.local:9000
volumeSnapshotLocation:
- name: default
provider: aws
config:
region: minio
credentials:
useSecret: "true"
name: minio-credentials
secretContents:
cloud: |
[default]
aws_access_key_id=xxxxx
aws_secret_access_key=xxxxxx
initContainers:
- name: velero-plugin-for-aws
image: velero/velero-plugin-for-aws:v1.11.0
volumeMounts:
- mountPath: /target
name: plugins

Setting up the Velero client (on a VM):

wget https://github.com/vmware-tanzu/velero/releases/download/v1.15.2/velero-v1.15.2-linux-amd64.tar.gz
tar -xvzf velero-v1.15.2-linux-amd64.tar.gz
sudo mv velero-v1.15.2-linux-amd64/velero /usr/local/bin/

The Velero client also works fine from a local PC.

Without a dedicated ingress or a LoadBalancer-type service, you can reach the MinIO web UI via port-forward.

kubectl port-forward svc/minio-console 9001:9001 -n minio

Go to http://localhost:9001. The backup bucket can be created through Velero (or via the CLI after installing the MinIO client on a VM), and backup/restore looks like this:

# Create a backup (example: targeting the busybox namespace)
velero backup create busybox-20250415-1421 --storage-location minio-backup --include-namespaces busybox
# Check backup status
velero backup get
# Restore from backup
velero restore create --from-backup busybox-20250415-1421
# Check restore status
velero restore get

Reference: AKS backup: standalone Velero install

Section titled “Reference: AKS backup: standalone Velero install”

Velero is a CNCF open-source project that helps back up and migrate K8s resources. It supports backing up everything configured in K8s, including Volumes. Backups it creates are provided for MinIO by default, but with the Azure plugin they can be stored in a Blob container instead. Since keeping backups inside the K8s cluster itself defeats the purpose of a backup, storing them in an external Blob container is the recommended approach.

Installing Velero

There’s a Helm-based install and a Velero CLI-based install (excluding the Azure Backup extension). Four options are provided for Azure auth integration.

  • Service Principal with secret-based auth
  • Service Principal with certificate-based auth
  • Azure AD Workload Identity
  • Storage Account Access Key

Following this project’s AKS design principles, we went with Workload Identity (Managed Identity)-based auth.

The Helm chart-based install had an issue with Managed Identity-based deployment at the time and couldn’t be installed. (Related issue: https://github.com/vmware-tanzu/helm-charts/issues/651)

CLI-based install

As prerequisites, create a Managed Identity, attach the required roles, and configure things so the Service Account Velero uses can assume that identity. Also set up the Storage Account and Container that will hold the backup data.

CLI install (example using the brew package manager):

brew install velero

Set up the Namespace, Service Account, and in-cluster permissions.

# Get Managed Identity ID
export AZURE_RESOURCE_GROUP=rg-az01-svc-platform-01
export IDENTITY_NAME=umi-az01-svc-platform-01
export AZURE_SUBSCRIPTION_ID=00000000-0000-0000-0000-000000000000
IDENTITY_CLIENT_ID="$(az identity show -g $AZURE_RESOURCE_GROUP -n $IDENTITY_NAME --subscription $AZURE_SUBSCRIPTION_ID --query clientId -otsv)"
# Create Namespace
kubectl create namespace velero
# Create Service Account
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
azure.workload.identity/client-id: $IDENTITY_CLIENT_ID
name: velero-service-account
namespace: velero
EOF
# create clusterrolebinding
cat <<EOF | kubectl apply -f -
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: velero
subjects:
- kind: ServiceAccount
name: velero-service-account
namespace: velero
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
EOF

Create the credentials file used for the Velero install.

cat << EOF > ./credentials-velero
AZURE_SUBSCRIPTION_ID=${AZURE_SUBSCRIPTION_ID}
AZURE_RESOURCE_GROUP=${AZURE_RESOURCE_GROUP}
AZURE_CLOUD_NAME=AzurePublicCloud
EOF

Install Velero. We put it in the same Resource Group as the AKS cluster, and added tolerations to the Velero Deployment where needed.

apiVersion: apps/v1
kind: Deployment
metadata:
name: velero
namespace: velero
labels:
component: velero
spec:
replicas: 1
selector:
matchLabels:
deploy: velero
template:
metadata:
labels:
azure.workload.identity/use: "true"
component: velero
deploy: velero
spec:
tolerations:
- key: MGMT
operator: Exists
containers:
# ... omitted below

Running a backup

After installing Velero, we can create backups. Backups can be on-demand or scheduled, and can be scoped to a namespace. Use the include/exclude namespace options to control backup scope.

# include namespaces
velero backup create <BACKUP-NAME> --include-namespaces <NAMESPACE-1>,<NAMESPACE-2>
# exclude namespaces
velero backup create <BACKUP-NAME> --exclude-namespaces kube-system,velero

Example of a backup targeting a specific service namespace:

velero backup create "sample-service-20250414" --include-namespaces sample-service

Once the backup completes successfully, you can see the Blob show up in the Storage Account.

This wraps up the Platform Engineering series, from the initial design of the cloud platform through CI/CD, the DevOps tool chain, LGTM-based unified observability, supply chain security, and finally this article’s Kubernetes operations practice: the actual approaches we established and applied on a real project. Standardizing Utility configuration, catching bottlenecks early with performance testing, and a two-layer Cloud/K8s backup strategy are the minimum safety net a platform needs to run reliably over the long term. We hope this series serves as a practical reference for designing and operating a cloud-native platform in a similar environment.

This article covered Azure and Kubernetes backup/recovery boundaries, AKS Backup, and Velero configuration. It completes the Kubernetes Operations subseries.

Previous: Cloud-native Performance Testing: Operating Locust and k6