Sziasztok,
itt olvasom: https://kubernetes.io/blog/2018/07/12/resizing-persistent-volumes-using…
hogy egy letrehozott pvc merete valtoztathato.
Az en esetemben:
$ kul get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
vsphere (default) kubernetes.io/vsphere-volume Delete Immediate true 2y302d
vsphere-storage-class kubernetes.io/vsphere-volume Delete Immediate false 10d
$ kul get pvc -n test4-ns-pkn
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
pvc-testpvcexpansion Bound pvc-1b2618cb-2687-4242-a478-d0f9d6306288 1Gi RWO vsphere 30m
Itt editalom a nagysagot 1G-rol 2G-ra:
# kul edit pvc pvc-testpvcexpansion -n mynamespace
# 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:
pv.kubernetes.io/bind-completed: "yes"
pv.kubernetes.io/bound-by-controller: "yes"
volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/vsphere-volume
creationTimestamp: "2023-11-13T03:33:11Z"
finalizers:
- kubernetes.io/pvc-protection
name: pvc-testpvcexpansion
namespace: mynamespace
resourceVersion: "503302910"
uid: 1b2618cb-2687-4242-a478-d0f9d6306288
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi #<--------------------------------------itt irtam at 1G-rol 2G-ra --------------------
storageClassName: vsphere
volumeMode: Filesystem
volumeName: pvc-1b2618cb-2687-4242-a478-d0f9d6306288
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
Nos, ha az ehhez hozzarendelt pod-ot megsemmisitem (kul delete pod proba -n mynamespace)
es kiirom ujra a pvc yaml fajljat, nem latom, hogy elkezdodott volna a resizing.
$ kul get pvc pvc-testpvcexpansion -o yaml -n mynamespace
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
pv.kubernetes.io/bind-completed: "yes"
pv.kubernetes.io/bound-by-controller: "yes"
volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/vsphere-volume
creationTimestamp: "2023-11-13T03:33:11Z"
finalizers:
- kubernetes.io/pvc-protection
name: pvc-testpvcexpansion
namespace: mynamespace
resourceVersion: "503302910"
uid: 1b2618cb-2687-4242-a478-d0f9d6306288
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
storageClassName: vsphere
volumeMode: Filesystem
volumeName: pvc-1b2618cb-2687-4242-a478-d0f9d6306288
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
Mi az, ami hianyzik az egeszbol vagy esetleg mi az, amit rosszul csinalok?
Koszonom elore a segitseget.
Ardi
UPDATE:
Ezt a hibat talaltam:
Ignoring the PVC: didn't find a plugin capable of expanding the volume; waiting for an external controll
er to process this PVC.
Hozzászólások
Ezek szerint valami olyan scenariod van ahol nem tudod resizeolni, ezt nézd meg sztem: https://docs.vmware.com/en/VMware-vSphere-Container-Storage-Plug-in/3.0…
Igen, nem derült ki hogy a StorageClass-ban be van-e kapcsolva az allowVolumeExpansion: true
Bocsi, de a kovetkezobol ezt nem latni?
$ kul get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
vsphere (default) kubernetes.io/vsphere-volume Delete Immediate true 2y302d
vsphere-storage-class kubernetes.io/vsphere-volume Delete Immediate false 10d
A pvc resizing-ról nekem az alábbi jutott eszembe. :)
https://youtu.be/LyBtgtVqOHQ?t=130
Nem néztem meg, de nekem is.
"Normális ember már nem kommentel sehol." (c) Poli
ennyi lenne, csak átírod a requestet és megcsinálja az átméretezést. milyen vsphere verzió? mert ha jól látom 7-től támogatott.
A vsphere verzio kiolvashato valahonnan?
Ardi
root@vcenter7 [ ~ ]# vpxd -v
VMware VirtualCenter 7.0.3 build-18778458
trey @ gépház
Bocsanat, azt hiszem, nem volt teljes az info, amit adtam.
A hozzaszolasomban Kubernetes alatt szeretnek pvc-t dynamikusan nagyitani. Nem tudom, hozzajutok-e olyan infokhoz, hogy
van-e ott vcenter, milyen diszkek vannak.
https://kubernetes.io/blog/2018/07/12/resizing-persistent-volumes-using… szerint
"Any PVC created from this
StorageClass
can be edited (as illustrated below) to request more space. Kubernetes will interpret a change to the storage field as a request for more space, and will trigger automatic volume resizing."ez menne.
Ardi
A kérdés h maga a vsphere támogatja e ezt: https://docs.vmware.com/en/VMware-vSphere-Container-Storage-Plug-in/3.0/vmware-vsphere-csp-getting-started/GUID-D4AAD99E-9128-40CE-B89C-AD451DA8379D.html#GUID-E59B13F5-6F49-4619-9877-DF710C365A1E
Szóval deritsd ki a vsphere verziót és a storage plugin verzót, aztán nézd meg a táblázatban h támogatott e ez.
egyébként ennyi az egész, ha minden támogatja:
$ kubectl create -f pvc-test.yml
persistentvolumeclaim/test-pvc created
$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
test-pvc Bound pvc-d4735399-213d-42e9-9d22-71e9a6305e52 1Gi RWO ontap-nas 7s
$ kubectl patch pvc test-pvc -p '{"spec":{"resources":{"requests":{"storage":"2Gi"}}}}'
persistentvolumeclaim/test-pvc patched
$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
test-pvc Bound pvc-d4735399-213d-42e9-9d22-71e9a6305e52 2Gi RWO ontap-nas 114s
...megprobalom - koszonom szepen.
Bar azt hiszem, ezt lesz a legnehezebb megszerezni.... :-(
Ardi