[Kubernetes] Resources

You can configure how the Kubernetes cluster makes use of resources (such as CPU an Memory) for each pods.

Container Resource Requirements

In a pod spec, you can specify the resources requirements of a container, which are defined in terms of resource requests and limits.

  • Container Memory and CPU requirements
  - name: myapp-container
    image: busybox
        memory: "64Mi"
        cpu: "250m"
        memory: "128Mi"
        cpu: "500m"

Resource Quotas

  • A resource quota provides constraints that limit aggregate resource consumption per namespace.
kubectl create quota myrq  
apiVersion: v1
kind: ResourceQuota
  name: myrq
    cpu: "1"
    memory: 1G
    pods: "2"
kubectl get quota
kubectl describe quota myrq

Default Resources for a Namespace

You can configure default CPU and memory requests and limits for a namespace.

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s