<p>I am unable to patch my statefulset to use a <code>RollingUpdate</code> strategy. </p>

<p>(Encountered while working through the "StatefulSet Basics" tutorial <a href="https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#rolling-update" rel="nofollow noreferrer">here</a>)</p>

<pre><code>$ kubectl patch statefulset web -p '{"spec":{"strategy":{"type":"RollingUpdate"}}}' 
statefulset "web" not patched
</code></pre>

<p>I wish <code>kubectl patch</code> would return more info as to the reason the statefulset could not be patched. </p>

<p><code>kubectl edit</code> tells me...</p>

<blockquote>
  <p>found invalid field updateStrategy for v1beta1.StatefulSetSpec </p>
</blockquote>

<p>But I am not sure I put the key and value in the proper place to be sure this is the same issue <code>patch</code> is encountering.</p>

<p>How do tell my statefulset to use a RollingUpdate strategy?</p>

<p>To reproduce this issue just follow the Kubernetes tutorial here: <a href="https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/" rel="nofollow noreferrer">https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/</a></p>

<p>Better to apply changes on your yaml file directly. </p>

<pre><code>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  
</code></pre>
