Skip to content
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

autoscaling/v2beta1 is no longer available in current kubernetes 1.25 #114

Open
anubisg1 opened this issue Sep 9, 2022 · 5 comments
Open

Comments

@anubisg1
Copy link

anubisg1 commented Sep 9, 2022

W0909 13:41:26.043561    3885 warnings.go:70] autoscaling/v2beta1 HorizontalPodAutoscaler is deprecated in v1.22+, unavailable in v1.25+; use autoscaling/v2 HorizontalPodAutoscaler

expectation is to use proper api reference as autoscaling would not working in the last release of kubernetes

@anubisg1
Copy link
Author

Error: UPGRADE FAILED: resource mapping not found for name: "netbox-netbox-worker" namespace: "" from "": no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta1"
ensure CRDs are installed first

indeed it fails on kubernetes 1.25

@rjhenry
Copy link
Contributor

rjhenry commented Sep 26, 2022

This should be simple enough to fix with a similar set of conditions as the CronJob resource.

According to the deprecated API migration guide, v1.23+ supports the autoscaling/v2 API version, so something along the lines of

{{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: batch/v2
{{- else -}}
apiVersion: autoscaling/v2beta1
{{- end }}

should do the trick.

@debdolph
Copy link

v2 will be removed in 1.26. We should use stable versions: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#api-object

@anubisg1
Copy link
Author

anubisg1 commented Feb 6, 2023

and since 1.26 is out now, we should be looking into fixing this.

@mld
Copy link

mld commented May 7, 2024

This looks like it'll be resolved in the upcoming 5.0.0-release: 664c10b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants