From 3067975811fefda769ad38d9f67db0fb2a6ed9f1 Mon Sep 17 00:00:00 2001 From: Shubhendu Date: Tue, 5 Dec 2023 11:04:26 +0530 Subject: [PATCH] Enable adding annotations of PVCs (#1897) Signed-off-by: Shubhendu Ram Tripathi --- api/tenant-handlers.go | 1 + helm/tenant/templates/tenant.yaml | 3 +++ helm/tenant/values.yaml | 3 +++ 3 files changed, 7 insertions(+) diff --git a/api/tenant-handlers.go b/api/tenant-handlers.go index 7a0f826018f..9d05f7eb02b 100644 --- a/api/tenant-handlers.go +++ b/api/tenant-handlers.go @@ -1292,6 +1292,7 @@ func parseTenantPool(pool *miniov2.Pool) *models.Pool { VolumeConfiguration: &models.PoolVolumeConfiguration{ Size: size, StorageClassName: storageClassName, + Annotations: pool.VolumeClaimTemplate.ObjectMeta.Annotations, }, NodeSelector: pool.NodeSelector, Resources: resources, diff --git a/helm/tenant/templates/tenant.yaml b/helm/tenant/templates/tenant.yaml index 1dabdf52136..1aef2a8d466 100644 --- a/helm/tenant/templates/tenant.yaml +++ b/helm/tenant/templates/tenant.yaml @@ -39,6 +39,9 @@ spec: volumeClaimTemplate: metadata: name: data + {{- with (dig "storageAnnotations" (dict) .) }} + annotations: {{- toYaml . | nindent 12 }} + {{- end }} spec: storageClassName: {{ dig "storageClassName" "" . }} accessModes: diff --git a/helm/tenant/values.yaml b/helm/tenant/values.yaml index 14a7e6dec8e..54d5d205a08 100644 --- a/helm/tenant/values.yaml +++ b/helm/tenant/values.yaml @@ -111,6 +111,9 @@ tenant: # Docs: https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/docs/parameters.md storageClassName: standard ### + # Specify `storageAnnotations `__ to associate to PVCs. + storageAnnotations: { } + ### # Specify `annotations `__ to associate to Tenant pods. annotations: { } ###