title: kubernetes / understanding CPU resources limits
body: <p>Coming from numerous years of running node/rails apps on bare metal; i was used to be able to run as many apps as i wanted on a single machine (let's say, a 2Go at digital ocean could easily handle 10 apps without worrying, based on correct optimizations or fairly low amount of traffic)</p>
  
  <p>Thing is, using kubernetes, the game sounds quite different.  I've setup a "getting started" cluster with 2 standard vm (3.75Go).</p>
  
  <p>Assigned a limit on a deployment with the following :</p>
  
  <pre><code>        resources:
            requests:
              cpu: "64m"
              memory: "128Mi"
            limits:
              cpu: "128m"
              memory: "256Mi"
  </code></pre>
  
  <p>Then witnessing the following :</p>
  
  <pre><code>Namespace       Name            CPU Requests    CPU Limits  Memory Requests Memory Limits
  ---------       ----            ------------    ----------  --------------- -------------
  default         api             64m (6%)        128m (12%)  128Mi (3%)      256Mi (6%)
  </code></pre>
  
  <p>What does this 6% refers to ?</p>
  
  <p>Tried to lower the CPU limit, to like, 20Mi… the app does to start (obviously, not enough resources). The docs says it is percentage of CPU. So, 20% of 3.75Go machine ? Then where this 6% comes from ? </p>
  
  <p>Then increased the size of the node-pool to the n1-standard-2, the same pod  effectively span 3% of node. That sounds logical, but what does it actually refers to ?</p>
  
  <p>Still wonder what is the metrics to be taken in account for this part.</p>
  
  <p>The app seems to need a large amount of memory on startup, but then it use only a minimal fraction of this 6%. I then feel like I misunderstanding something, or misusing it all</p>
  
  <p>Thanks for any experienced tips/advices to have a better understanding
  Best</p>