Skip to content

Commit 4dfb47d

Browse files
authored
Merge pull request #9487 from Lyndon-Li/issue-fix-for-cache-volume
Fix issue for cache volume
2 parents f388a5c + e72fea8 commit 4dfb47d

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

pkg/controller/data_download_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ func (r *DataDownloadReconciler) setupExposeParam(dd *velerov2alpha1api.DataDown
918918
cacheVolume = &exposer.CacheConfigs{
919919
Limit: limit,
920920
StorageClass: r.cacheVolumeConfigs.StorageClass,
921-
ResidentThreshold: r.cacheVolumeConfigs.ResidentThreshold,
921+
ResidentThreshold: r.cacheVolumeConfigs.ResidentThresholdInMB << 20,
922922
}
923923
}
924924
}

pkg/controller/pod_volume_restore_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ func (r *PodVolumeRestoreReconciler) setupExposeParam(pvr *velerov1api.PodVolume
934934
cacheVolume = &exposer.CacheConfigs{
935935
Limit: limit,
936936
StorageClass: r.cacheVolumeConfigs.StorageClass,
937-
ResidentThreshold: r.cacheVolumeConfigs.ResidentThreshold,
937+
ResidentThreshold: r.cacheVolumeConfigs.ResidentThresholdInMB << 20,
938938
}
939939
}
940940
}

pkg/types/node_agent.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ type RestorePVC struct {
6868

6969
type CachePVC struct {
7070
// StorageClass specifies the storage class for cache PVC
71-
StorageClass string
71+
StorageClass string `json:"storageClass,omitempty"`
7272

73-
// ResidentThreshold specifies the minimum size of the backup data to create cache PVC
74-
ResidentThreshold int64
73+
// ResidentThresholdInMB specifies the minimum size of the backup data to create cache PVC
74+
ResidentThresholdInMB int64 `json:"residentThresholdInMB,omitempty"`
7575
}
7676

7777
type NodeAgentConfigs struct {

site/content/docs/main/data-movement-cache-volume.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A sample of cache PVC configuration as part of the ConfigMap would look like:
1616
```json
1717
{
1818
"cachePVC": {
19-
"thresholdInGB": 1,
19+
"residentThresholdInMB": 1024,
2020
"storageClass": "sc-wffc"
2121
}
2222
}
@@ -29,7 +29,7 @@ kubectl create cm node-agent-config -n velero --from-file=<json file name>
2929

3030
A must-have field in the configuration is `storageClass` which tells Velero which storage class is used to provision the cache PVC. Velero relies on Kubernetes dynamic provision process to provision the PVC, static provision is not supported.
3131

32-
The cache PVC behavior could be further fine tuned through `thresholdInGB`. Its value is compared to the size of the backup, if the size is smaller than this value, no cache PVC would be created when restoring from the backup. This ensures that cache PVCs are not created in vain when the backup size is too small and can be accommodated in the data mover pods' root disk.
32+
The cache PVC behavior could be further fine tuned through `residentThresholdInMB`. Its value is compared to the size of the backup, if the size is smaller than this value, no cache PVC would be created when restoring from the backup. This ensures that cache PVCs are not created in vain when the backup size is too small and can be accommodated in the data mover pods' root disk.
3333

3434
This configuration decides whether and how to provision cache PVCs, but it doesn't decide their size. Instead, the size is decided by the specific backup repository. Specifically, Velero asks a cache limit from the backup repository and uses this limit to calculate the cache PVC size.
3535
The cache limit is decided by the backup repository itself, for Kopia repository, if `cacheLimitMB` is specified in the backup repository configuration, its value will be used; otherwise, a default limit (5 GB) is used.

site/data/docs/main-toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ toc:
7676
- page: Data Movement Node Selection Configuration
7777
url: /data-movement-node-selection
7878
- page: Data Movement Cache PVC Configuration
79-
url: /data-movement-cache-volume.md
79+
url: /data-movement-cache-volume
8080
- page: Node-agent Concurrency
8181
url: /node-agent-concurrency
8282
- title: Plugins

0 commit comments

Comments
 (0)