kubernetes cpu limit code example

Example 1: kubernetes resources limits

resources:
      requests:
        memory: "64Mi"
        cpu: "250m"
      limits:
        memory: "128Mi"
        cpu: "500m"

Example 2: set right limit in kubernetes pods tool

kubectl describe pod memory-demo-2 --namespace=mem-example

Example 3: set right limit in kubernetes pods tool

... Normal  Created   Created container with id 66a3a20aa7980e61be4922780bf9d24d1a1d8b7395c09861225b0eba1b1f8511
... Warning BackOff   Back-off restarting failed container