traefik-helm-chart
traefik-helm-chart copied to clipboard
Update HPA API Version, add support for behavior
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
- [X] Yes, I updated the chart version
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.
@kevinpollet any update on this one, could you please have a look at this again?
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.
I rebased my branch to the latest changes and would appreciate someone having a look at this PR.
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 ?
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).
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.
Hello @mrx88,
There is
type: Podsin the output. It's expected (and alphabetically ordered) output. In this example,periodSeconds,typeandvalueare part of the same policy. It doesn't matter ifperiodSecondsis before or aftertypeas 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 ;)