netbox-chart icon indicating copy to clipboard operation
netbox-chart copied to clipboard

autoscaling/v2beta1 is no longer available in current kubernetes 1.25

Open anubisg1 opened this issue 2 years ago • 4 comments

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 avatar Sep 09 '22 13:09 anubisg1

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

anubisg1 avatar Sep 22 '22 20:09 anubisg1

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.

rjhenry avatar Sep 26 '22 13:09 rjhenry

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

debdolph avatar Nov 20 '22 20:11 debdolph

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

anubisg1 avatar Feb 06 '23 12:02 anubisg1

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

mld avatar May 07 '24 14:05 mld

Closing as fixed in 5.0.0 releases

LeoColomb avatar Jun 13 '24 11:06 LeoColomb