如何更改现有持久卷的存储类? [英] How do I change the storage class of existing persistent volumes?
问题描述
我在Google Kubernetes Engine中运行的Kubernetes中有一堆与PVC绑定的标准PV.我想将其存储类更改为SSD.我该如何实现?
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?
推荐答案
如果我对您的理解正确,那么您想更改PV的类型,问题不是"if"而是"where".
If I understood you correctly, you would like to change a type for your PVs, and the question is not "if" but "where".
PVC,PV和StorageClass之间的关系非常简单.
The relations between PVC, PV and StorageClass is very simple.
PVC仅要求存储特定的类型(在storageClassName
下指定)和大小(在PV中列出).
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在spec:
中具有storageClassName
.
kind: PersistentVolume
...
spec:
capacity:
storage: 10Gi
...
storageClassName: slow
storageClass
具有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?
这篇关于如何更改现有持久卷的存储类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!