<p>I have this manifest</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: cert-manager
  namespace: &quot;cert-manager&quot;
spec:
  template:
    spec:
      containers:
        nodeSelector:
          app.myapp.com/environment: system
</code></pre>
<p>When I try to apply with <code>kubectl</code> I get this error:</p>
<blockquote>
<p>error: wrong Node Kind for  expected: SequenceNode was MappingNode: value: {nodeSelector:
app.myapp.com/environment: system}</p>
</blockquote>
<p>What can be?</p>

Rodrigo
<p>As mentioned by @mdaniel, a container is an array, you have to mention the field name preceding with “-” inside a container. Here in your use case, removing the leading ”-” from nodeSelector: has turned the container from an array member into a dict. So, you will need to mention “-” to the nodeSelector field.</p>
<p>Refer to the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">Deployments</a> for more information on how to define containers.</p>
