HorizontalPodAutoscaler: autoscaler/v2beta2 is not available in K8s 1.26
Problem Description:
Kubernetes has removed autoscaling/v2beta2
in K8s 1.26.
Error:
Helm install failed: unable to build kubernetes objects from release manifest: resource mapping not found for name: "confluence" namespace: "" from "": no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta2"
ensure CRDs are installed first
Workaround:
Use the postRenderers on the Helm Release to patch the API version
postRenderers:
- kustomize:
patchesJson6902:
- target:
kind: HorizontalPodAutoscaler
name: confluence
patch:
- op: replace
path: /apiVersion
value: autoscaling/v2
Recommended solution:
Use Helm to query the available API versions in the cluster, then apply the appropriate API version.