traefik-helm-chart icon indicating copy to clipboard operation
traefik-helm-chart copied to clipboard

Update HPA API Version, add support for behavior

Open grieshaber opened this issue 4 years ago • 3 comments
trafficstars

What does this PR do?

This MR updates the API-Version of the hpa to autoscaling/v2beta2. Since k8s 1.18, this api-version adds support for custom scaling behavior. Therefore i added some example values and the corresponding property in hpa.yaml.

Motivation

Requested by @Xyaren in #515

More

Additional Notes

I wrapped the behavior property in the hpa in an additional if clause, because it is only supported in clusters >= 1.18, so it won't break things and needs to be enabled explicitly.

grieshaber avatar Oct 29 '21 06:10 grieshaber

@kevinpollet any update on this one, could you please have a look at this again?

junaid-ali avatar Nov 30 '21 12:11 junaid-ali

this is also relevant since v2beta2 allows specifying multiple metrics for the HPA to scale on. Right now we're constrained to a single metric.

cilindrox avatar Jan 24 '22 16:01 cilindrox

I rebased my branch to the latest changes and would appreciate someone having a look at this PR.

grieshaber avatar Jan 25 '22 06:01 grieshaber

Hello,

@jburke-godaddy Thanks for your suggestion. I edited the PR following this suggestion and added some tests.

@grieshaber Any comments on this new version of your PR ?

mloiseleur avatar Oct 05 '22 14:10 mloiseleur

FYI - maybe due to helm version problems (did not verify), but this part is not rendering correctly when using the example configuration with Helm v3.10.1:

{{- if .Values.autoscaling.behavior }}
  behaviour: 
{{ toYaml .Values.autoscaling.behavior | indent 4 }}
{{- end }}

Output is:

 behavior:
    scaleDown:
      policies:
      - periodSeconds: 60
        type: Pods
        value: 1
      stabilizationWindowSeconds: 300

but should be:

  behavior:
    scaleDown:
      stabilizationWindowSeconds: 300
      policies:
      - type: Pods
        value: 1
        periodSeconds: 60

(Note the -type is missing).

mrx88 avatar Nov 02 '22 06:11 mrx88

Hello @mrx88,

There is type: Pods in the output. It's expected (and alphabetically ordered) output. In this example, periodSeconds, type and value are part of the same policy. It doesn't matter if periodSeconds is before or after type as long as they are in the same policy.

mloiseleur avatar Nov 02 '22 08:11 mloiseleur

Hello @mrx88,

There is type: Pods in the output. It's expected (and alphabetically ordered) output. In this example, periodSeconds, type and value are part of the same policy. It doesn't matter if periodSeconds is before or after type as long as they are in the same policy.

I was pointing out to "-" char missing for Type, but if it works that way too then no worries ;)

mrx88 avatar Nov 02 '22 08:11 mrx88