Kubernetes

Resource Requests/Limits

jih0ssang 2024. 2. 13. 16:19

Request

  • pod를 생성할 때 필요한 Resource 최소치


Limits

  • Pod가 사용할 수 있는 Resource 최대치



Throttling

  • cpu가 과도할 때, 강제로 down 시킴

 

CPU

  • Limit 넘어서는 경우, throttling 발생 우려

Memory

  • Limit 넘어서는 경우, Pod 종료
apiVersion: v1
kind: Pod
metadata:
  name: sample-pod
  labels:
    sample: app
spec:
  containers:
  - name: sample-webapp-color
    image: simple-webapp-color
    ports:
    - containerPort: 8080
    resources:
      requests:
        cpu: 1
        memory: "1Gi"
      limits:
        cpu: 2
        memory: "2Gi"