<p><em>I'm trying to set the cpu consumption of my container from inside a deployment.<br>
Unfortunatly it seems that kube is not taking it into account...</em></p>

<pre class="lang-yaml prettyprint-override"><code>resources:
  requests:
    cpu: "0.2"
</code></pre>

<p>When describing the deployment it should display the requests:</p>

<pre><code>$ kubectl describe deployment redis
...
  Containers:
   redis:
    Image:        redis:alpine
    Port:         6379/TCP
    Host Port:    0/TCP
    Environment:  &lt;none&gt;
    Mounts:
      /redis-master-data from data (rw)
  Volumes:
...
</code></pre>

<p><strong>Where is the request I set ???</strong></p>

<p>The complete deployment so you can test at home ;-)</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: redis
  name: redis
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redis
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: redis
    spec:
      nodeName: master
      containers:
      - image: redis:alpine
        name: redis
        ports:
        - containerPort: 6379
        volumeMounts:
        - mountPath: /redis-master-data
          name: data
        resources:               # &lt;======= Here
          requests:
            cpu: "0.2"
        resources: {}
      volumes:
      - name: data
        emptyDir: {}
status: {}
</code></pre>

<p>FYI :  It's just a test pod and has nothing to do with redis in particular.<br>
Thx  </p>

Doctor
<p>Your config is wrong. You have two <code>resources</code></p>

<pre><code>        resources:               # &lt;======= Here
          requests:
            cpu: "0.2"
        resources: {}
</code></pre>

<p>Remove <code>resources: {}</code> and run <code>kubectl describe deployment redis</code></p>

<pre><code>Pod Template:
  Labels:  app=redis
  Containers:
   redis:
    Image:      redis:alpine
    Port:       6379/TCP
    Host Port:  0/TCP
    Requests:
      cpu:        200m
    Environment:  &lt;none&gt;
</code></pre>
