spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden

what 发表于: 2024-01-18   最后更新时间: 2024-01-18 18:00:30   284 游览

更新statefulset类型的volumeClaimTemplate报:

spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden

请问我该如何解决?
如何更新?

发表于 2024-01-18

意思是除了'replicas', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' 和 'minReadySeconds',其他的都禁止更新。

备份一下当前 statefulset 的文件,删除当前的statefulset,重新apply新的文件。

kubectl delete statefulsets xxxx
kubectl apply -f new.yaml

重点是pv的东西还在,我就这么处理了。

你的答案

查看kubernetes相关的其他问题或提一个您自己的问题