<p>I wrote down a simple Deploymnet yaml and it fails with the error</p>

<pre><code>kubectl create -f deployment.yaml
error: error validating "deployment.yaml": error validating data: the server could not find the requested resource; if you choose to ignore these errors, turn validation off with --validate=false
</code></pre>

<p>This used to work in the previous versions and if i turn --validate=false it still helps but i would like to understand why the error is seen.</p>

<p>My deployment.yaml file</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: httpd-deployment
  labels:
    app: httpd
spec:
  replicas: 1
  selector:
    matchLabels:
      app: httpd
  template:
    metadata:
      labels:
        app: httpd
    spec:
      containers:
      - name: httpd
        image: httpd:latest
        ports:
        - containerPort: 80
        resources:
          requests:
          cpu: "0.3"
          memory: "500Mi"
</code></pre>

<p>I'm running thsi on minikube and the minikube version is:
    minikube version: v1.2.0</p>

<p>Are there any standards that we need to follow for the new version for creating the deployment yaml file. </p>

<p>There are no errors that are displayed except these warning so Troubeshooting this is becoming a pain.</p>

<p>So if there is anything that can help me fix could you please help.</p>

<p>Thank you</p>

anish anil
<p>This is an issue with kubectl validating what is going to be sent into the API server rather than Minikube itself.</p>

<p>The error is in the indentation as <code>cpu</code> and <code>memory</code> properties should be nested within requests and <strong>not</strong> in resources:</p>

<pre><code>spec:
      containers:
      - name: httpd
        image: httpd:latest
        ports:
        - containerPort: 80
        resources:
          requests:
            cpu: "0.3"
            memory: "500Mi"
</code></pre>

<p>I've tested it using kubectl v1.15.0 and the error was correctly displayed:</p>

<pre><code>$ kubectl apply -f test.yaml
$ error: error validating "test.yaml": error validating data: [ValidationError(Deployment.spec.template.spec.containers[0].resources): unknown field "cpu" in io.k8s.api.core.v1.ResourceRequirements, ValidationError(Deployment.spec.template.spec.containers[0].resources): unknown field "memory" in io.k8s.api.core.v1.ResourceRequirements]; if you choose to ignore these errors, turn validation off with --validate=false
</code></pre>
