Automatic volume expansion
Automatic volume expansion enables Persistent Volumes (PVs) provisioned by Trident to grow automatically when their used capacity reaches a defined threshold.
This capability is implemented using Autogrow Policies (AGPs). An Autogrow Policy defines:
-
The utilization threshold that triggers expansion
-
The amount by which the volume grows
-
The maximum size the volume can reach
Automatic volume expansion reduces operational overhead and helps prevent application disruption caused by full volumes.
Requirements
-
Trident 26.02 or later
-
RBAC permissions to create
TridentAutogrowPolicycustom resources -
StorageClasses must include
allowVolumeExpansion: true -
Supported ONTAP protocols:
-
NFS
-
iSCSI
-
FCP
-
NVMe
-
|
|
ONTAP NVMe raw block volumes earlier than ONTAP 9.16.1 do not support automatic expansion. |
|
|
For SAN volumes, if growthAmount is less than or equal to 50MiB, Trident increases the value to 51MiB before resizing, provided the resulting size does not exceed maxSize.
|
|
|
In brownfield environments, automatic expansion might not function for certain existing volumes due to volume publication migration behavior. |
Create an Autogrow Policy
Autogrow Policies are Kubernetes custom resources of type TridentAutogrowPolicy.
An Autogrow Policy defines when and how volumes expand.
Field definitions
| Field | Description | Required |
|---|---|---|
|
Unique policy identifier. |
Yes |
|
Percentage of used capacity that triggers expansion. |
Yes |
|
Amount to grow when the threshold is reached. Can be specified as a percentage (for example, |
No |
|
Maximum volume size limit. If not specified, the volume can grow without an enforced upper limit. |
No |
Example: Standard Autogrow Policy
The following example creates a policy that triggers expansion at 80% utilization, grows by 10%, and limits growth to 500Gi.
apiVersion: trident.netapp.io/v1
kind: TridentAutogrowPolicy
metadata:
name: standard-autogrow
spec:
usedThreshold: "80%"
growthAmount: "10%"
maxSize: "500Gi"
Create the policy
-
Save the YAML definition to a file.
-
Apply the policy:
kubectl apply -f autogrow-policy.yaml
-
Verify creation:
kubectl get tridentautogrowpolicy standard-autogrow
Expected output:
NAME USED THRESHOLD GROWTH AMOUNT STATE standard-autogrow 80% 10% Success
Configuration examples
Conservative policy for production databases
Use a lower threshold and larger growth increment for production database workloads where avoiding capacity exhaustion is critical.
apiVersion: trident.netapp.io/v1
kind: TridentAutogrowPolicy
metadata:
name: production-db-policy
spec:
usedThreshold: "75%"
growthAmount: "20%"
maxSize: "5Ti"
Log storage with fixed growth
Use a fixed-size increment when predictable growth steps are preferred.
apiVersion: trident.netapp.io/v1
kind: TridentAutogrowPolicy
metadata:
name: log-storage-policy
spec:
usedThreshold: "90%"
growthAmount: "10Gi"
maxSize: "100Gi"
Autogrow Policy with defaults
If only usedThreshold is specified, growthAmount defaults to 10% and maxSize is unlimited.
apiVersion: trident.netapp.io/v1
kind: TridentAutogrowPolicy
metadata:
name: logs-policy
spec:
usedThreshold: "85%"
Autogrow Policy with default growthAmount
Specify a maximum size while using the default growth increment.
apiVersion: trident.netapp.io/v1
kind: TridentAutogrowPolicy
metadata:
name: default-ga-policy
spec:
usedThreshold: "70%"
maxSize: "100Gi"
Autogrow Policy with default maxSize
Allow unrestricted growth while specifying a custom growth percentage.
apiVersion: trident.netapp.io/v1
kind: TridentAutogrowPolicy
metadata:
name: default-ms-policy
spec:
usedThreshold: "80%"
growthAmount: "150%"
Autogrow Policy with fractional percentages
Fractional percentages allow granular control of thresholds and growth increments.
apiVersion: trident.netapp.io/v1
kind: TridentAutogrowPolicy
metadata:
name: fractional-policy
spec:
usedThreshold: "80.28%"
growthAmount: "10.65%"
maxSize: "100Gi"
Policy states
| State | Description |
|---|---|
Success |
Policy validated and ready for use. |
Failed |
Validation errors detected. Review and correct the specification. |
Deleting |
Deletion in progress. Finalizers prevent removal while volumes reference the policy. |
Manage Autogrow Policies
List policies
kubectl get tridentautogrowpolicy
View policy details
kubectl describe tridentautogrowpolicy production-db-policy
Using tridentctl
tridentctl get autogrowpolicy tridentctl get autogrowpolicy production-db-policy -o yaml
Update an Autogrow Policy
|
|
Changes affect all volumes currently using the policy. |
kubectl edit tridentautogrowpolicy production-db-policy
Updates apply during the next growth operation. Volume restart is not required.
Delete an Autogrow Policy
Autogrow Policies include finalizer protection to prevent deletion while in use.
kubectl delete tridentautogrowpolicy production-db-policy
If volumes reference the policy, it remains in the Deleting state until all references are removed.
To identify volumes using a policy:
tridentctl get autogrowpolicy production-db-policy -o yaml
Remove policy from volumes:
kubectl annotate pvc <pvc-name> \ trident.netapp.io/autogrowPolicy="none" \ --overwrite
Configure Autogrow Policy on a StorageClass
Associate a policy using the trident.netapp.io/autogrowPolicy annotation.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: ontap-gold
annotations:
trident.netapp.io/autogrowPolicy: "production-db-policy"
provisioner: csi.trident.netapp.io
parameters:
backendType: "ontap-san"
fsType: "ext4"
allowVolumeExpansion: true
Verify annotation:
kubectl get storageclass ontap-gold \
-o jsonpath='{.metadata.annotations.trident\.netapp\.io/autogrowPolicy}'
Update Autogrow Policy on a StorageClass
kubectl annotate storageclass ontap-gold \ trident.netapp.io/autogrowPolicy="standard-autogrow" \ --overwrite
Remove Autogrow Policy from a StorageClass
Option 1: Remove annotation
kubectl annotate storageclass ontap-gold \ trident.netapp.io/autogrowPolicy-
Option 2: Set annotation to none
kubectl annotate storageclass ontap-gold \ trident.netapp.io/autogrowPolicy="none" \ --overwrite
Apply Autogrow Policy to a PVC
Apply a policy at the PVC level to override StorageClass behavior.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: database-pvc
annotations:
trident.netapp.io/autogrowPolicy: "production-db-policy"
spec:
storageClassName: ontap-gold
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Gi
Disable Autogrow on a PVC:
kubectl annotate pvc database-pvc \ trident.netapp.io/autogrowPolicy="none" \ --overwrite
Monitor Autogrow Policy Usage
List policies:
kubectl get tridentautogrowpolicy
Find which policy a PVC uses:
kubectl get pvc database-pvc \
-o jsonpath='{.metadata.annotations.trident\.netapp\.io/autogrowPolicy}'
Monitor events:
kubectl get events \ --field-selector involvedObject.kind=TridentAutogrowPolicy
Troubleshooting
| Issue | Possible cause | Resolution |
|---|---|---|
Policy in |
Invalid specification |
Correct the policy and reapply |
Volume does not expand |
|
Increase |
Frequent expansions |
Threshold too low |
Increase |
PVC shows |
Policy does not exist |
Verify policy name |
PVC shows |
Policy in |
Resolve validation errors |
TAGRI repeatedly rejected |
|
Increase |