[英]kubectl patch statefulset updateStrategy RollingUpdate NOT patched
I am unable to patch my statefulset to use a RollingUpdate
strategy. 我无法修补statefulset以使用
RollingUpdate
策略。
(Encountered while working through the "StatefulSet Basics" tutorial here ) (在此处阅读“ StatefulSet基础”教程时遇到)
$ kubectl patch statefulset web -p '{"spec":{"strategy":{"type":"RollingUpdate"}}}'
statefulset "web" not patched
I wish kubectl patch
would return more info as to the reason the statefulset could not be patched. 我希望
kubectl patch
将返回更多有关无法修补statefulset的信息。
kubectl edit
tells me... kubectl edit
告诉我...
found invalid field updateStrategy for v1beta1.StatefulSetSpec
发现v1beta1.StatefulSetSpec的无效字段updateStrategy
But I am not sure I put the key and value in the proper place to be sure this is the same issue patch
is encountering. 但是我不确定是否将密钥和值放在正确的位置,以确保这是
patch
遇到的同一问题。
How do tell my statefulset to use a RollingUpdate strategy? 如何告诉我的状态集使用RollingUpdate策略?
To reproduce this issue just follow the Kubernetes tutorial here: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/ 要重现此问题,请按照此处的Kubernetes教程进行: https ://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/
Better to apply changes on your yaml file directly. 最好直接将更改应用于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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.