0

As mentioned in this answer: allow for easy updating of a Replica Set as well as the ability to roll back to a previous deployment.

So, kind: Deployment scales replicasets, which scales Pods, supports zero-downtime updates by creating and destroying replicasets


What is the purpose of HorizontalPodAutoscaler resource type?

apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: xyz
spec:
  maxReplicas: 4
  minReplicas: 2
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: xyz
  targetCPUUtilizationPercentage: 70
overexchange
  • 15,768
  • 30
  • 152
  • 347

1 Answers1

1

As you write, with a Deployment it is easy to manually scale an app horizontally, by changing the numer of replicas.

By using a HorizontalPodAutoscaler, you can automate the horizontal scaling by e.g. configuring some metric thresholds, therefore the name autoscaler.

Jonas
  • 121,568
  • 97
  • 310
  • 388