This is the documentation for the latest development version of Velero. Both code and docs may be unstable, and these docs are not guaranteed to be up to date or correct. See the latest version.
The Velero node-agent is a DaemonSet that hosts modules for completing backup and restore operations, including file system backup/restore and CSI snapshot data movement. This document provides comprehensive configuration options for the ConfigMap provisioned by node-agent’s --node-agent-configmap parameter.
Node-agent puts advanced configurations of data movement and PodVolume operations into a ConfigMap that contains JSON configuration. The ConfigMap should be created in the same namespace where Velero is installed, and its name is specified using the --node-agent-configmap parameter.
For detailed information, see Node-agent Concurrency.
Notice: The ConfigMap’s life cycle control is out of the scope of Velero. User need to create and maintain the ConfigMap themselves.
The ConfigMap name can be specified during Velero installation:
velero install --node-agent-configmap=<ConfigMap-Name>
To create the ConfigMap:
kubectl create cm <ConfigMap-Name> -n velero --from-file=<json-file-name>
To apply the ConfigMap to the node-agent DaemonSet:
kubectl edit ds node-agent -n velero
Add the ConfigMap reference to the container arguments:
spec:
template:
spec:
containers:
- args:
- --node-agent-configmap=<ConfigMap-Name>
Important: The node-agent server checks configurations at startup time. After editing the ConfigMap, restart the node-agent DaemonSet for changes to take effect.
kubectl rollout restart -n <velero-namespace> daemonset/node-agent
loadConcurrency)Controls the concurrent number of data movement operations per node to optimize resource usage and performance.
For detailed information, see Node-agent Prepare Queue Length.
Sets a default concurrent number applied to all nodes:
{
"loadConcurrency": {
"globalConfig": 2
}
}
Specify different concurrent numbers for specific nodes using label selectors:
{
"loadConcurrency": {
"globalConfig": 2,
"perNodeConfig": [
{
"nodeSelector": {
"matchLabels": {
"kubernetes.io/hostname": "node1"
}
},
"number": 3
},
{
"nodeSelector": {
"matchLabels": {
"beta.kubernetes.io/instance-type": "Standard_B4ms"
}
},
"number": 5
}
]
}
}
Use Cases:
Control the maximum number of backup/restore operations that can be in preparation phases simultaneously. The concurrency numbers controls how many backup/restore operations can run at the same time. The prepare queue length controls how many backup/restore operations can create the workload pods that are pending for start. If there are thousands of volume B/R operations, and without this control, thousands of B/R pods will be created at the same time, then causing a big burden on the k8s API server.
{
"loadConcurrency": {
"prepareQueueLength": 10
}
}
Use Cases:
Affected CR Phases:
Accepted or Prepared phasesloadAffinity)Constrains which nodes can run data movement operations using affinity and anti-affinity rules.
For detailed information, see Node Selection for Data Movement.
{
"loadAffinity": [
{
"nodeSelector": {
"matchLabels": {
"beta.kubernetes.io/instance-type": "Standard_B4ms"
},
"matchExpressions": [
{
"key": "kubernetes.io/hostname",
"values": ["node-1", "node-2", "node-3"],
"operator": "In"
},
{
"key": "critical-workload",
"operator": "DoesNotExist"
}
]
}
}
]
}
Configure different node selection rules for specific storage classes:
fast-ssd, the first match is chosen, which is nodes with label "environment": "production".hdd, the nodes with label "environment": "backup" are chosen.{
"loadAffinity": [
{
"nodeSelector": {
"matchLabels": {
"environment": "production"
}
},
"storageClass": "fast-ssd"
},
{
"nodeSelector": {
"matchLabels": {
"environment": "staging"
}
},
"storageClass": "fast-ssd"
},
{
"nodeSelector": {
"matchLabels": {
"environment": "backup"
}
},
"storageClass": "hdd"
}
]
}
Important Limitations:
loadAffinity array is used for general node selectionstorageClass fieldmatchLabels and matchExpressions in a single elementUse Cases:
podResources)Configure CPU and memory resources for data mover pods to optimize performance and prevent resource conflict. The configurations work for PodVolumeBackup, PodVolumeRestore, DataUpload, and DataDownload pods.
{
"podResources": {
"cpuRequest": "1000m",
"cpuLimit": "2000m",
"memoryRequest": "1Gi",
"memoryLimit": "4Gi"
}
}
Use Cases:
Values: Must be valid Kubernetes Quantity expressions
Validation: Request values must not exceed limit values
Default: BestEffort QoS if not specified
Failure Handling: Invalid values cause the entire podResources section to be ignored
For detailed information, see Data Movement Pod Resource Configuration.
priorityClassName)Configure the node-agent created pod’s PriorityClass. The configurations work for PodVolumeBackup, PodVolumeRestore, DataUpload, and DataDownload pods.
Configure pod priority to control scheduling behavior:
High Priority (e.g., system-cluster-critical):
Low Priority (e.g., low-priority):
Example:
{
"priorityClassName": "low-priority"
}
backupPVC)Configure intermediate PVCs used during data movement backup operations for optimal performance.
For detailed information, see BackupPVC Configuration for Data Movement Backup.
storageClass: Alternative storage class for backup PVCs (defaults to source PVC’s storage class)readOnly: This is a boolean value. If set to true then ReadOnlyMany will be the only value set to the backupPVC’s access modes. Otherwise ReadWriteOnce value will be used.spcNoRelabeling: This is a boolean value. If set to true, then pod.Spec.SecurityContext.SELinuxOptions.Type will be set to spc_t. From the SELinux point of view, this will be considered a Super Privileged Container which means that selinux enforcement will be disabled and volume relabeling will not occur. This field is ignored if readOnly is false.Use Cases:
Important Notes:
spcNoRelabeling: true when using readOnly: trueAccepted phase until timeout (30m default)Configure different backup PVC settings per source storage class:
{
"backupPVC": {
"fast-storage": {
"storageClass": "backup-storage-1"
},
"slow-storage": {
"storageClass": "backup-storage-2"
}
}
}
Create BackupPVC in ReadOnly mode, which can avoid full data clone during backup process in some storage providers, such as Ceph RBD.
In an SELinux-enabled cluster, any time users set readOnly=true they must also set spcNoRelabeling=true.
{
"backupPVC": {
"source-storage-class": {
"storageClass": "backup-optimized-class",
"readOnly": true,
"spcNoRelabeling": true
}
}
}
restorePVC)Configure intermediate PVCs used during data movement restore operations.
{
"restorePVC": {
"ignoreDelayBinding": true
}
}
ignoreDelayBinding: Ignore WaitForFirstConsumer binding mode constraintsUse Cases:
Important Notes:
For detailed information, see RestorePVC Configuration for Data Movement Restore.
privilegedFsBackup)Add privileged permission in PodVolumeBackup and PodVolumeRestore created pod’s SecurityContext, because in some k8s environments, mounting HostPath volume needs privileged permission to work.
In v1.17, the PodVolumeBackup and PodVolumeRestore are micro-serviced into independent pods, but they still mount the target volume by HostPath way. As a result, privileged permission are needed.
{
"privilegedFsBackup": true
}
For detailed information, see Enable file system backup document
cachePVCConfig)Configure intermediate PVCs used for data movement restore operations to cache the downloaded data.
For detailed information, see Cache PVC Configuration for Data Movement Restore.
thresholdInGB: Minimum backup data size (in GB) to trigger cache PVC creation during restorestorageClass: Storage class used to create cache PVCs.Use Cases:
Important Notes:
{
"cachePVCConfig": {
"thresholdInGB": 1,
"storageClass": "cache-optimized-storage"
}
}
Here’s a comprehensive example showing how all configuration sections work together:
{
"loadConcurrency": {
"globalConfig": 2,
"prepareQueueLength": 15,
"perNodeConfig": [
{
"nodeSelector": {
"matchLabels": {
"kubernetes.io/hostname": "node1"
}
},
"number": 3
}
]
},
"loadAffinity": [
{
"nodeSelector": {
"matchLabels": {
"node-type": "backup"
},
"matchExpressions": [
{
"key": "critical-workload",
"operator": "DoesNotExist"
}
]
}
},
{
"nodeSelector": {
"matchLabels": {
"environment": "staging"
}
},
"storageClass": "fast-ssd"
}
],
"podResources": {
"cpuRequest": "500m",
"cpuLimit": "1000m",
"memoryRequest": "1Gi",
"memoryLimit": "2Gi"
},
"priorityClassName": "backup-priority",
"backupPVC": {
"fast-storage": {
"storageClass": "backup-optimized-class",
"readOnly": true,
"spcNoRelabeling": true
},
"slow-storage": {
"storageClass": "backup-storage-2"
}
},
"restorePVC": {
"ignoreDelayBinding": true
},
"privilegedFsBackup": true,
"cachePVC": {
"thresholdInGB": 1,
"storageClass": "cache-optimized-storage"
}
}
This configuration:
node1spcNoRelabeling: true when using readOnly: trueTo verify your configuration is loaded correctly:
kubectl logs -n velero -l app=node-agent | grep -i config
To check current node-agent configuration:
kubectl get cm <ConfigMap-Name> -n velero -o yaml
For detailed information on specific configuration sections:
To help you get started, see the documentation.