0

My deployment never auto-scale on DigitalOcean. I have on my devspace.yaml

deployments:
- name: app
  namespace: "mynamespace"
  helm:
    componentChart: true
    values:
      replicas: 1
      autoScaling:
        horizontal:
          maxReplicas: 3
          averageCPU: 5m
          # averageRelativeCPU: 1
      containers:
      - name: app
        image: pablorsk/app

Always has 1 replica. I try with small values on averageCPU like 5m o averageRelativeCPU like 1, but never upgrade replicas on cluster.

$ kubectl get hpa
NAME     REFERENCE           TARGETS         MINPODS   MAXPODS   REPLICAS   AGE
app      Deployment/app      <unknown>/5m   1         3         1          13d

This is my node configuration on DigitalOcean:

enter image description here

pablorsk
  • 3,861
  • 1
  • 32
  • 37
  • Can you share the configuration of your `Horizontal Pod Autoscaling` object? – rock'n rolla Apr 11 '21 at 13:07
  • Hi @rock'nrolla, I just have previous yaml on `devspace.yaml`. I need to add a new section on yaml? Or an personalized kubernetes manifest? Or you need the generated manifest of app POD? – pablorsk Apr 11 '21 at 18:28

1 Answers1

0

HPA installation is required for auto-scale deployments.

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml

Then, you can see values for TARGETS

$ kubectl get hpa
NAME     REFERENCE           TARGETS         MINPODS   MAXPODS   REPLICAS   AGE
app      Deployment/app      216/5m          1         3         1          1d

More information on metrics-server repository.

pablorsk
  • 3,861
  • 1
  • 32
  • 37