Skip to main content
NetApp Response to Russia-Ukraine Cyber Threat
In response to the recent rise in cyber threat due to the Russian-Ukraine crisis, NetApp is actively monitoring the global security intelligence and updating our cybersecurity measures. We follow U.S. Federal Government guidance and remain on high alert. Customers are encouraged to monitor the Cybersecurity and Infrastructure Security (CISA) website for new information as it develops and remain on high alert.
NetApp Knowledge Base

Can Trident with Kubernetes or Openshift reduce the size of a deployed, persistent volume (PV) ?

Views:
186
Visibility:
Public
Votes:
0
Category:
trident-kubernetes
Specialty:
snapx
Last Updated:

Applies to

  • Trident for Kubernetes/Openshift 19.07 and higher
  • Kubernetes (K8s) 1.16 and higher
  • Openshift 4.5 and higher

Answer

The option allowVolumeExpansion was added for storage classes in Kubernetes 1.16 and equivalent Openshift version 4.5, and is supported by Trident 19.07 and higher to easily increase the size of the persistent volume after its deployment.

However, a reduction/decrease in volume size has currently not been implemented, and the size parameter is checked against current size to make sure  you are only increasing the size compared to the existing volume size. See also the second point under iSCSI expansion.

A possible usage, apart from creating a replacement PV and migrating the data, would be to reduce usage of space from the aggregate on ONTAP storage, by generally not using space reservations and leave it on thin provisioning. This can be checked on the backend definition or the storage class, and is the default.

Additional Information

Although it seems reasonable when free space in the volume is plenty, that a volume should be able to decrease in size as well, for iSCSI PV's this is not possible, since the data location on the virtual disk can be at the end of the virtualized file, meaning that reducing the size could loose data.

For NFS volumes, this could theoretically be implemented, but would require a similar setting from Kubernetes itself (e.g. allowVolumeReduction).

 

Scan to view the article on your device