<p>I am new to k8s and need some help, plz.</p>
<p>I want to make a change in a pod's deployment configuration and change readOnlyRootFilesystem to false.</p>
<p>This is what I am trying to do, but it doesn't seem to work. Plz suggest what's wrong:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl patch deployment eric-ran-rdm-singlepod -n vdu -o yaml -p {&quot;spec&quot;:{&quot;template&quot;:{&quot;spec&quot;:{&quot;containers&quot;:[{&quot;name&quot;:&quot;eric-ran-rdm-infra&quot;:{&quot;securityContext&quot;:[{&quot;readOnlyRootFilesystem&quot;:&quot;true&quot;}]}}]}}}}
</code></pre>
<p><a href="https://i.stack.imgur.com/cEIYl.png" rel="nofollow noreferrer">enter image description here</a></p>
<p>Thanks very much!!</p>

<p>Your JSON is invalid. You need to make sure you are providing valid JSON and it should be in the correct structure as defined by the k8s API as well. You can use <a href="https://jsonlint.com" rel="nofollow noreferrer">jsonlint.com</a>.</p>
<pre class="lang-json prettyprint-override"><code>{
    &quot;spec&quot;: {
        &quot;template&quot;: {
            &quot;spec&quot;: {
                &quot;containers&quot;: [
                    {
                        &quot;name&quot;: &quot;eric-ran-rdm-infra&quot;,
                        &quot;securityContext&quot;: {
                            &quot;readOnlyRootFilesystem&quot;: &quot;true&quot;
                        }
                    }
                ]
            }
        }
    }
}
</code></pre>
<blockquote>
<p>Note: I have only checked the syntax here and <strong>not</strong> checked/ tested the structure against the k8s API of this JSON here, but I think it should be right, please correct me if I am wrong.</p>
</blockquote>
<p>It might be easier to specify a deployment in a <code>.yaml</code> file and just apply that using <code>kubectl apply -f my_deployment.yaml</code>.</p>
