-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start using autoscaling/v2 for HorizontalPodAutoscaler #414
Start using autoscaling/v2 for HorizontalPodAutoscaler #414
Conversation
c58d0d4
to
4c04611
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do something like this until 1.26+. To keep functionality with older clusters.
{/*
Determine the policy api version
*/}}
{{- define "cortex.pdbVersion" -}}
{{- if or (.Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget") (semverCompare ">=1.21" .Capabilities.KubeVersion.Version) -}}
policy/v1
{{- else -}}
policy/v1beta1
{{- end -}}
{{- end -}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, however please put the code in templates/_helpers.tpl
global helpers file to avoid unnecessary code duplication just like with the pdbversion.
Then you can refer to it like this
apiVersion: {{ include "cortex.hpaVersion" . }}
On a side note: We should also check if something changed between v1beta1 and v1 (but I guess it shouldn't have?)
7ad269b
to
44bbbb2
Compare
by the docs, it seems that nothing has changed. |
templates/_helpers.tpl
Outdated
Get cortex hpa version by k8s version | ||
*/}} | ||
{{- define "cortex.hpaVersion" -}} | ||
{{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (semverCompare ">=1.23" .Capabilities.KubeVersion.Version) -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (semverCompare ">=1.23" .Capabilities.KubeVersion.Version) -}} | |
{{- if or (.Capabilities.APIVersions.Has "autoscaling/v2/HorizontalPodAutoscaler") (semverCompare ">=1.23" .Capabilities.KubeVersion.Version) -}} |
Should be this
8a1d286
to
58b3fe8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@GuyKomari Check the Lint Test Job for error logs. There is some error evaluating the helm-chart. Also please update the
|
58b3fe8
to
53440c4
Compare
I ran the ct lint locally and it passes now, so the github action should pass now. |
What this Commit does / why we need it: Problem: chart-testing is failing for: "autoscaling/v2beta2 HorizontalPodAutoscaler is deprecated in v1.23+, unavailable in v1.26+; use autoscaling/v2" https://github.com/cortexproject/cortex-helm-chart/actions/runs/3606103570/jobs/6077123598 Solution: update charts to start using autoscaler/v2 in v1.23+ Signed-off-by: guykomari <guykomari@gmail.com>
53440c4
to
3b22074
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
…texproject#414) What this Commit does / why we need it: Problem: chart-testing is failing for: "autoscaling/v2beta2 HorizontalPodAutoscaler is deprecated in v1.23+, unavailable in v1.26+; use autoscaling/v2" https://github.com/cortexproject/cortex-helm-chart/actions/runs/3606103570/jobs/6077123598 Solution: update charts to start using autoscaler/v2 in v1.23+ Signed-off-by: guykomari <guykomari@gmail.com> Signed-off-by: guykomari <guykomari@gmail.com>
What this PR does / why we need it:
Problem: chart-testing is failing for:
"autoscaling/v2beta2 HorizontalPodAutoscaler is deprecated in v1.23+, unavailable in v1.26+; use autoscaling/v2"
https://github.com/cortexproject/cortex-helm-chart/actions/runs/3606103570/jobs/6077123598
Solution: update charts to start using autoscaler/v2
Signed-off-by: guykomari guykomari@gmail.com