helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

[loki-distributed] Invalid autoscaling api version

Open rbudiharso opened this issue 1 year ago • 3 comments

I got this error when I'm going to upgrade a loki-distributed release

$ helm upgrade --install loki-release -f values.yml grafana/loki-distributed
Error: UPGRADE FAILED: unable to build kubernetes objects from current release manifest: [resource mapping not found for name: "loki-dist-loki-distributed-distributor" namespace: "" from "": no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta1"
ensure CRDs are installed first, resource mapping not found for name: "loki-dist-loki-distributed-gateway" namespace: "" from "": no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta1"
ensure CRDs are installed first, resource mapping not found for name: "loki-dist-loki-distributed-querier" namespace: "" from "": no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta1"
ensure CRDs are installed first, resource mapping not found for name: "loki-dist-loki-distributed-query-frontend" namespace: "" from "": no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta1"
ensure CRDs are installed first]

I've check the code for determine the autoscaling version which is this part

{{/*
Return the appropriate apiVersion for HorizontalPodAutoscaler.
*/}}
{{- define "loki.hpa.apiVersion" -}}
  {{- if and (.Capabilities.APIVersions.Has "autoscaling/v2") (semverCompare ">=1.23-0" .Capabilities.KubeVersion.Version) -}}
    {{- print "autoscaling/v2" -}}
  {{- else -}}
    {{- print "autoscaling/v2beta1" -}}
  {{- end -}}
{{- end -}}

but I have the autoscaling/v2 and my kubernetes version is 1.27 CleanShot 2023-07-30 at 19 24 38@2x CleanShot 2023-07-30 at 19 25 17@2x

I'm pretty sure I should have autoscaling/v2 selected, why is it returning autoscaling/v2beta1 ?

rbudiharso avatar Jul 30 '23 12:07 rbudiharso