<p><strong>kube@Big:/mnt/c/Users/Big_Picture/Desktop/ClinZilla$</strong> kubectl apply -f yaml-validator.yaml
error: error validating &quot;yaml-validator.yaml&quot;: error validating data: ValidationError(Deployment.spec.template.metadata): unknown field &quot;nodeSelector&quot; in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta; if you choose to ignore these errors, turn validation off with --validate=false
<a href="https://i.stack.imgur.com/bhSTt.png" rel="nofollow noreferrer">Checker yaml syntax</a></p>
<p><a href="https://i.stack.imgur.com/AIi4P.png" rel="nofollow noreferrer">Reuslt running command</a></p>

Abd El-Rhman Khamis
<p>NodeSelector is not a field of the &quot;metadata&quot; section of your pod template.
it needs to be under &quot;spec.template.spec&quot;.</p>
<p>see this example:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: rss-site
  labels:
    app: web
spec:
  replicas: 2
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      nodeSelector: &lt;--- WRONG
        disktype: ssd &lt;-- ALSO WRONG BECAUSE IT IS PART OF NODESELECTOR
      labels:
        app: web
    spec:
      nodeSelector: &lt;--- CORRECT
        disktype: ssd 
      containers:
        - name: front-end
          image: nginx
          ports:
            - containerPort: 80
        - name: rss-reader
          image: nickchase/rss-php-nginx:v1
          ports:
            - containerPort: 88
</code></pre>
