diff --git a/internal/assets/manifests/istio-discovery/templates/autoscale.yaml b/internal/assets/manifests/istio-discovery/templates/autoscale.yaml index d3257c8a9..d262800e0 100644 --- a/internal/assets/manifests/istio-discovery/templates/autoscale.yaml +++ b/internal/assets/manifests/istio-discovery/templates/autoscale.yaml @@ -1,5 +1,5 @@ {{- if and (eq .Values.global.mode "ACTIVE") .Values.pilot.autoscaleEnabled .Values.pilot.autoscaleMin .Values.pilot.autoscaleMax }} -apiVersion: autoscaling/v2 +apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }} kind: HorizontalPodAutoscaler metadata: name: {{ include "name-with-revision" ( dict "name" "istiod" "context" $) }} diff --git a/internal/assets/manifests/istio-meshgateway/templates/autoscale.yaml b/internal/assets/manifests/istio-meshgateway/templates/autoscale.yaml index 49e6493c6..ada47d32f 100644 --- a/internal/assets/manifests/istio-meshgateway/templates/autoscale.yaml +++ b/internal/assets/manifests/istio-meshgateway/templates/autoscale.yaml @@ -1,6 +1,6 @@ {{ $gateway := .Values.deployment }} {{- if and $gateway.autoscaleEnabled $gateway.autoscaleMin $gateway.autoscaleMax }} -apiVersion: autoscaling/v2 +apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }} kind: HorizontalPodAutoscaler metadata: name: {{ $gateway.name }} diff --git a/internal/assets/manifests/istio-sidecar-injector/templates/autoscale.yaml b/internal/assets/manifests/istio-sidecar-injector/templates/autoscale.yaml index 5f6228cdf..6cb103e23 100644 --- a/internal/assets/manifests/istio-sidecar-injector/templates/autoscale.yaml +++ b/internal/assets/manifests/istio-sidecar-injector/templates/autoscale.yaml @@ -1,5 +1,5 @@ {{- if and .Values.deployment.autoscaleEnabled .Values.deployment.autoscaleMin .Values.deployment.autoscaleMax }} -apiVersion: autoscaling/v2 +apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }} kind: HorizontalPodAutoscaler metadata: name: {{ include "name-with-revision" ( dict "name" "istio-sidecar-injector" "context" $) }}