[root@k8s loganalysis]# kubectl get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
managed-nfs-storage (default) fuseim.pri/ifs Delete Immediate true 20d
[root@k8s loganalysis]# kubectl edit sc managed-nfs-storage
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
allowVolumeExpansion: true ### 新增
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"storage.k8s.io/v1","kind":"StorageClass","metadata":{"annotations":{},"name":"managed-nfs-storage"},"parameters":{"archiveOnDelete":"false"},"provisioner":"fuseim.pri/ifs"}
storageclass.kubernetes.io/is-default-class: "true"
creationTimestamp: "2021-12-16T11:08:19Z"
name: managed-nfs-storage
resourceVersion: "2234273"
selfLink: /apis/storage.k8s.io/v1/storageclasses/managed-nfs-storage
uid: bb61eb6a-8657-484f-96d8-a35e032b2ff4
parameters:
archiveOnDelete: "false"
provisioner: fuseim.pri/ifs
reclaimPolicy: Delete
volumeBindingMode: Immediate
[root@k8s loganalysis]# kubectl edit pvc es-pvc-01 -n loganalysis
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{"volume.beta.kubernetes.io/storage-class":"managed-nfs-storage"},"name":"es-pvc-01","namespace":"loganalysis"},"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"1Gi"}}}}
pv.kubernetes.io/bind-completed: "yes"
pv.kubernetes.io/bound-by-controller: "yes"
volume.beta.kubernetes.io/storage-class: managed-nfs-storage
volume.beta.kubernetes.io/storage-provisioner: fuseim.pri/ifs
creationTimestamp: "2022-01-06T03:01:56Z"
finalizers:
- kubernetes.io/pvc-protection
name: es-pvc-01
namespace: loganalysis
resourceVersion: "2235154"
selfLink: /api/v1/namespaces/loganalysis/persistentvolumeclaims/es-pvc-01
uid: ad055832-7ea0-4ae0-a24a-f56f885182e4
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi ### 修改扩容大小
volumeMode: Filesystem
volumeName: pvc-ad055832-7ea0-4ae0-a24a-f56f885182e4
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
Ignoring the PVC: didn’t find a plugin capable of expanding the volume; waiting for an external controller to process this PVC.
参考:https://cloud.tencent.com/developer/article/1602852
Although the feature is enabled by default, a cluster admin must opt-in to allow users to resize their volumes. Kubernetes v1.11 ships with volume expansion support for the following in-tree volume plugins: AWS-EBS, GCE-PD, Azure Disk, Azure File, Glusterfs, Cinder, Portworx, and Ceph RBD.
NFS并不被支持
—>>> https://www.cnblogs.com/fat-girl-spring/p/15176272.html