I have a bunch of standard PVs bound to PVCs in Kubernetes running in Google Kubernetes Engine. I want to change their storage class to SSD. How do I achieve that?
No it's not possible to change the storage class of an existing PVC.You will have to create a new PVC with desired storage class and then delete the existing one.
If I understood you correctly, you would like to change a type for your PVs, and the question is not "if" but "where".
The relations between PVC, PV and StorageClass is very simple.
PVC is just request for a storage of particular type (specified under storageClassName
) and size (that is listed in PV) .
kind: PersistentVolumeClaim
spec:
...
resources:
requests:
storage: 8Gi
storageClassName: slow
PV has storageClassName
in spec:
.
kind: PersistentVolume
...
spec:
capacity:
storage: 10Gi
...
storageClassName: slow
The storageClass
has type
.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: slow
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-standard
fstype: ext4
replication-type: none
# type: pd-standard or pd-ssd. Default: pd-standard
Is it the info you've been looking for?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With