减少 Kubernetes 持久卷。

huangapple go评论82阅读模式
英文:

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.

  1. Scaling down the application and pods.
  2. 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.

  1. Scaling down the application and pod.
  2. 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

huangapple
  • 本文由 发表于 2020年1月6日 16:53:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/59609128.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定