Infra2026년 2월 18일2분 읽기

Kubernetes Horizontal Pod Autoscaler — 자동 스케일링

YS
YoungSam
조회 1230

HPA 설정

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: api-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: api-server
  minReplicas: 2
  maxReplicas: 20
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 70
    - type: Pods
      pods:
        metric:
          name: http_requests_per_second
        target:
          type: AverageValue
          averageValue: "100"

KEDA를 사용하면 큐 길이, 크론 스케줄 등 더 다양한 메트릭으로 스케일링할 수 있습니다.

KubernetesHPAAutoscaling

댓글 0

아직 댓글이 없습니다.