<p>When following tutorial: <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> i run into error. The following command fails:</p>

<pre><code>kubectl patch sts web -p '{"spec":{"replicas":3}}'

Error from server (BadRequest): json: cannot unmarshal string into Go value of type map[string]interface {}
</code></pre>

<p>How do I fix this?</p>

<p>This is the container image on pods: k8s.gcr.io/nginx-slim:0.8 </p>

<p>I am using minikube on Windows 7 Pro and standard cmd shell.</p>

<p>kubectl version</p>

<pre><code>Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", 
GitCommit:"2bd9643cee5b3b3a5ecbd3af
9d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", 
GoVersion:"go1.12.9", Compiler:"gc"
Platform:"windows/amd64"}

Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", 
GitCommit:"2bd9643cee5b3b3a5ecbd3af
9d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:27:17Z", 
GoVersion:"go1.12.9", Compiler:"gc"
Platform:"linux/amd64"}
</code></pre>

hal
<p>Try surrounding it with double quotes and then escaping the double quotes inside:</p>

<pre><code>kubectl patch sts web -p "{\"spec\":{\"replicas\":3}}"
</code></pre>
