英文:
Reduce kubernetes Persistent Volumes
问题
I am using multiple apps on Kubernetes and all are configured with pd-ssd
volumes. Some deployments are running on large volumes with less data. So I want to reduce the volume of the pods. I have worked on increasing the volume size, and it worked. But I can't reduce the volume space.
Steps I followed:
Current size is 100Gi, and I want to resize it to 30Gi.
- Scaling down the application and pods.
- Editing the PVC to reduce the size of the volume using the following command:
k edit pvc my-pvc
However, I encountered the following error when trying to save the changes:
error: persistentvolumeclaims "my-pvc" is invalid
A copy of your changes has been stored to "/tmp/kubectl-edit-4ivk1.yaml"
error: Edit canceled, no valid changes were saved.
I'm unable to save the changes to reduce the volume size.
英文:
I am using multiple apps on kubernetes and all are configured with pd-ssd
volume. Some deployments are running on big volume with less data. So i wanted to reduce that volume of the pods. I have worked with increase volumen and it was worked. But i can't reduce the space of the volume.
Steps i did. Current size is 100Gi, I want to resize it to 30Gi.
- Scaling down the application and pod.
- edit pvc to reduce the size of volume.
k edit pvc my-pvc
I got the following error when I save the changes.
> error: persistentvolumeclaims "my-pvc" is invalid
A copy of your changes has been stored to "/tmp/kubectl-edit-4ivk1.yaml"
error: Edit cancelled, no valid changes were saved.
But i can not able to save the changes for reduce volume size.
答案1
得分: 5
在Kubernetes中,不支持缩小持久卷的大小,您只能增加它。
使用Kubernetes调整持久卷大小
英文:
Shrinking persistent volumes is not supported in kubernetes, you can only increase it.
resizing-persistent-volumes-using-kubernetes
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论