Updated:

less than 1 minute read

VerticalPodAutoscaler

  • 리소스를 추가한 파드를 생성하여 기존 파드를 대체

HorizontalPodAutoscaler

  • 동일한 파드를 생성/삭제하여 스케일링
  • ex
     ---
     apiVersion: v1
     kind: Service
     metadata:
       name: read-front
     spec:
       ports:
         - name: grpc
           port: 50000
           protocol: TCP
       selector:
         app: read-front
    	
     ---
     apiVersion: autoscaling/v2beta2
     kind: HorizontalPodAutoscaler
     metadata:
       name: xxx
       namespace: default
     spec:
       scaleTargetRef:
         apiVersion: apps/v1
         kind: Deployment
         name: deployment-name
       minReplicas: 1
       maxReplicas: 10
       metrics:
         - type: Resource
           resource:
             name: cpu
             target:
               type: Utilization
               averageUtilization: 50
         - type: Resource
           resource:
             name: memory
             target:
               type: AverageValue
               averageValue: 100Mi
         - type: Pods
           pods:
             metric:
               name: packets-per-second
             target:
               type: AverageValue
               averageValue: 1k
         - type: Object
           object:
             metric:
               name: requests-per-second
             describedObject:
               apiVersion: networking.k8s.io/v1beta1
               kind: Ingress
               name: main-route
             target:
               type: Value
               value: 1k