<p>When I run the command</p>
<pre><code>kubectl create -f .k8s/deployment.yaml --context=cluster-1
</code></pre>
<p>I get the error</p>
<blockquote>
<p>error: error validating &quot;.k8s/deployment.yaml&quot;: error validating data: ValidationError(Deployment.spec.template.spec.containers[0]): unknown field &quot;volumes&quot; in io.k8s.api.core.v1.Container; if you choose to ignore these errors, turn validation off with --validate=false</p>
</blockquote>
<p><code>deployment.yaml</code></p>
<pre><code>apiVersion: apps/v1
kind: Deployment
  ...
    spec:
      containers:
        ...
        volumes:
        - name: auth
          secret:
            secretName: d-secrets
            items:
            - key: SECRETS
              path: foobar.json

</code></pre>
<p>What can be?</p>

<p><code>...unknown field &quot;volumes&quot; in io.k8s.api.core.v1.Container</code></p>
<p>Your <code>volumes</code> section is placed wrongly. Try:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
spec:
  ...
  template:
    ...
    spec:
      containers:
      - name: ...
        ...
      volumes:  &lt;-- should be same level as `containers`
      - name: auth
        secret:
          secretName: d-secrets
          items:
          - key: SECRETS
            path: foobar.json
</code></pre>
