본문 바로가기

CKA &. CKAD/Scheduling

Resource Limits

0.

 

Default

 

Pod가 생성되면 컨테이너에 기본 CPU Request .5와 Memory 256Mi 가 할당된다.

Pod가 이러한 기본 값을 선택하려면 먼저 해당 Namespace에 LimitRange를 만들어 Request 및 Limit에 대한 기본값으로 설정해야 함.

apiVersion: v1
kind: LimitRange
metadata:
  name: mem-limit-range
spec:
  limits:
  - default:
      memory: 512Mi
    defaultRequest:
      memory: 256Mi
    type: Container

https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/memory-default-namespace/

 

Configure Default Memory Requests and Limits for a Namespace

This page shows how to configure default memory requests and limits for a namespace. If a Container is created in a namespace that has a default memory limit, and the Container does not specify its own memory limit, then the Container is assigned the defau

kubernetes.io

apiVersion: v1
kind: LimitRange
metadata:
  name: cpu-limit-range
spec:
  limits:
  - default:
      cpu: 1
    defaultRequest:
      cpu: 0.5
    type: Container

https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace/

 

Configure Default CPU Requests and Limits for a Namespace

This page shows how to configure default CPU requests and limits for a namespace. A Kubernetes cluster can be divided into namespaces. If a Container is created in a namespace that has a default CPU limit, and the Container does not specify its own CPU lim

kubernetes.io

 

References:

https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource

 

Assign Memory Resources to Containers and Pods

This page shows how to assign a memory request and a memory limit to a Container. A Container is guaranteed to have as much memory as it requests, but is not allowed to use more memory than its limit. Before you begin You need to have a Kubernetes cluster,

kubernetes.io