Loading

k8s pvc扩容

#查看是否支持扩容
$ kubectl get sc ** -o yaml
···
allowVolumeExpansion: true   #拥有该字段表示允许动态扩容
···
#找到需要扩容的pvc
$ kubectl get pvc
NAME      STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
rbd-hub   Bound    pvc-86f12741-f915-4340-aee0-ae114562659a   1Gi       RWX            rook-cephfs    20h
$ kubectl edit pvc rbd-hub
···
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 100Gi #修改此处限额值
···
#扩容成功
$ kubectl get pvc rbd-hub
NAME      STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
rbd-hub   Bound    pvc-86f12741-f915-4340-aee0-ae114562659a   100Gi      RWX            rook-cephfs    20h
posted @ 2022-06-01 18:19  亚里士多智  阅读(299)  评论(0编辑  收藏  举报