<pre><code>    apiVersion: v1
    kind: Pod
    metadata:
      creationTimestamp: null
      labels:
        run: nginx4
      name: nginx4
    spec:
      containers:
      - image: nginx
        name: nginx4
      nodeSelector:
        app: "v1-tesla"
        resources: {}
      dnsPolicy: ClusterFirst
      restartPolicy: Never
    status: {}
</code></pre>

<p>When I run the above template kubectl create -f pod.yaml, I get the following error:</p>

<pre><code>    error: error validating "podOnANode.yaml": error validating data: 
    ValidationError(Pod.spec.nodeSelector.resources): invalid type for 
    io.k8s.api.core.v1.PodSpec.nodeSelector: got "map", expected 
    "string"; if you choose to ignore these errors, turn validation off 
    with --validate=false
</code></pre>

<p>Any pointers to fix this would be great.</p>

Avi
<p>The above error is for:</p>

<pre><code>nodeSelector:
  app: "v1-tesla"
  resources: {}
</code></pre>

<p>Here, <code>resources: {}</code> representing <code>map</code>, but it should be <code>string</code>. So remove <code>resources: {}</code> or change it's value to <code>string</code>.</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: nginx4
  name: nginx4
spec:
  containers:
  - image: nginx
    name: nginx4
  nodeSelector:
    app: "v1-tesla"
    resources: "whatever"
  dnsPolicy: ClusterFirst
  restartPolicy: Never
status: {}
</code></pre>
