我无法修补我的状态设置以使用RollingUpdate
策略。
(在完成“StatefulSet基础知识”教程here)时遇到
$ kubectl patch statefulset web -p '{"spec":{"strategy":{"type":"RollingUpdate"}}}'
statefulset "web" not patched
我希望kubectl patch
能够返回有关无法修补状态集的原因的更多信息。
kubectl edit
告诉我......
找到v1beta1.StatefulSetSpec
的无效字段updateStrategy
但我不确定我是否将关键和价值放在适当的位置,以确保这是patch
遇到的同一问题。
如何告诉我的statefulset使用RollingUpdate策略?
要重现此问题,请按照此处的Kubernetes教程进行操作:https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/
答案 0 :(得分:0)
更好地将更改直接应用于yaml文件。
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: nginx-sts
spec:
serviceName: "nginx-headless"
replicas: 3
#podManagementPolicy: Parallel
selector:
matchLabels:
run: nginx-sts-demo
updateStrategy:
rollingUpdate:
partition: 0 #for full partition update
type: RollingUpdate