简体   繁体   English

kubectl补丁状态集更新策略RollingUpdate未补丁

[英]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.

相关问题 Kubectl tls 补丁返回“未修补” - Kubectl tls patch returning “not patched” 如何使用 kubectl 给 statefulset envFrom 打补丁 - How to use to kubectl to patch statefulset envFrom 使用 kubectl patch 将卷添加到 Kubernetes StatefulSet - Adding a volume to a Kubernetes StatefulSet using kubectl patch 为什么使用 kubectl patch rollingupdate-strategy 不重启 pod - why using kubectl patch rollingupdate-strategy doesn't restart the pod Kubectl rollout restart for statefulset - Kubectl rollout restart for statefulset Kubernetes statefulset:禁止'replicas'、'template'和'updateStrategy'以外 - Kubernetes statefulset : other than 'replicas', 'template', and 'updateStrategy' are forbidden 禁止:禁止更新“副本”、“模板”、“updateStrategy”和“minReadySeconds”以外的字段的 statefulset 规范 - Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', 'updateStrategy' and 'minReadySeconds' are forbidden 禁止:禁止更新“副本”、“模板”和“更新策略”以外的字段的状态集规范 - Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden Kubectl 补丁 $deleteFromPrimitiveList 指令 - Kubectl patch $deleteFromPrimitiveList directive Kubectl 等待 statefulset 的一个 pod 准备就绪? - Kubectl wait for one pod of a statefulset to be READY?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM