diff --git a/helm/higress/Chart.yaml b/helm/higress/Chart.yaml index 23f2e70bfc..9ef7de1624 100644 --- a/helm/higress/Chart.yaml +++ b/helm/higress/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 0.5.0 +appVersion: 0.5.1 description: Helm chart for deploying higress gateways icon: https://higress.io/img/higress_logo_small.png keywords: @@ -9,4 +9,4 @@ name: higress sources: - http://github.com/alibaba/higress type: application -version: 0.5.0 +version: 0.5.1 diff --git a/helm/higress/templates/hpa.yaml b/helm/higress/templates/hpa.yaml index 713260c8fd..91c88e4c29 100644 --- a/helm/higress/templates/hpa.yaml +++ b/helm/higress/templates/hpa.yaml @@ -1,5 +1,6 @@ {{- if .Values.gateway.autoscaling.enabled }} -apiVersion: autoscaling/v2beta2 +{{- if not .Values.global.autoscalingv2API }} +apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: name: {{ include "gateway.name" . }} @@ -9,20 +10,46 @@ metadata: annotations: {{- .Values.gateway.annotations | toYaml | nindent 4 }} spec: + minReplicas: {{ .Values.gateway.autoscaling.minReplicas }} + maxReplicas: {{ .Values.gateway.autoscaling.maxReplicas }} scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: {{ include "gateway.name" . }} + metrics: + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.gateway.autoscaling.targetCPUUtilizationPercentage }} +--- +{{- else }} +{{- if (semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion)}} +apiVersion: autoscaling/v2 +{{- else }} +apiVersion: autoscaling/v2beta2 +{{- end }} +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "gateway.name" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "gateway.labels" . | nindent 4 }} + annotations: + {{- .Values.gateway.annotations | toYaml | nindent 4 }} +spec: minReplicas: {{ .Values.gateway.autoscaling.minReplicas }} maxReplicas: {{ .Values.gateway.autoscaling.maxReplicas }} + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "gateway.name" . }} metrics: - {{- if .Values.gateway.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - averageUtilization: {{ .Values.gateway.autoscaling.targetCPUUtilizationPercentage }} - type: Utilization - {{- end }} - + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.gateway.autoscaling.targetCPUUtilizationPercentage }} +--- +{{- end }} {{- end }} diff --git a/helm/higress/values.yaml b/helm/higress/values.yaml index fd2b185d49..e28ab4a79e 100644 --- a/helm/higress/values.yaml +++ b/helm/higress/values.yaml @@ -1,3 +1,7 @@ +global: + # whether to use autoscaling/v2 template for HPA settings + # for internal usage only, not to be configured by users. + autoscalingv2API: true hub: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress ingressClass: "" watchNamespace: "" @@ -9,7 +13,7 @@ gateway: name: "higress-gateway" replicaCount: 2 image: gateway - tag: "" + tag: "04cfef254aade907478c2b70cf576bb5eb310047" # revision declares which revision this gateway is a part of revision: "" @@ -82,7 +86,7 @@ gateway: memory: 2048Mi autoscaling: - enabled: true + enabled: false minReplicas: 1 maxReplicas: 5 targetCPUUtilizationPercentage: 80 @@ -100,7 +104,7 @@ controller: name: "higress-controller" replicaCount: 1 image: higress - tag: "" + tag: "04cfef254aade907478c2b70cf576bb5eb310047" env: {} replicaCount: 1 diff --git a/helm/istio/Chart.yaml b/helm/istio/Chart.yaml index a267f199a6..d05a29fb6b 100644 --- a/helm/istio/Chart.yaml +++ b/helm/istio/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 1.12.0 +appVersion: 1.12.1 description: Helm chart for deploying higress istio name: istio sources: @@ -12,4 +12,4 @@ dependencies: repository: "file://../istiod" version: 1.12.0 type: application -version: 1.12.0 +version: 1.12.1 diff --git a/helm/istiod/templates/autoscale.yaml b/helm/istiod/templates/autoscale.yaml index b8b14ad0ba..2edcc745ea 100644 --- a/helm/istiod/templates/autoscale.yaml +++ b/helm/istiod/templates/autoscale.yaml @@ -1,4 +1,5 @@ {{- if and .Values.pilot.autoscaleEnabled .Values.pilot.autoscaleMin .Values.pilot.autoscaleMax }} +{{- if not .Values.global.autoscalingv2API }} apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: @@ -23,4 +24,36 @@ spec: name: cpu targetAverageUtilization: {{ .Values.pilot.cpu.targetAverageUtilization }} --- +{{- else }} +{{- if (semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion)}} +apiVersion: autoscaling/v2 +{{- else }} +apiVersion: autoscaling/v2beta2 +{{- end }} +kind: HorizontalPodAutoscaler +metadata: + name: istiod{{- if not (eq .Values.revision "") }}-{{ .Values.revision }}{{- end }} + namespace: {{ .Release.Namespace }} + labels: + app: istiod + release: {{ .Release.Name }} + istio.io/rev: {{ .Values.revision | default "default" }} + install.operator.istio.io/owning-resource: {{ .Values.ownerName | default "unknown" }} + operator.istio.io/component: "Pilot" +spec: + maxReplicas: {{ .Values.pilot.autoscaleMax }} + minReplicas: {{ .Values.pilot.autoscaleMin }} + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: istiod{{- if not (eq .Values.revision "") }}-{{ .Values.revision }}{{- end }} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.pilot.cpu.targetAverageUtilization }} +--- +{{- end }} {{- end }} diff --git a/helm/istiod/templates/poddisruptionbudget.yaml b/helm/istiod/templates/poddisruptionbudget.yaml index 40b2e60154..454737a696 100644 --- a/helm/istiod/templates/poddisruptionbudget.yaml +++ b/helm/istiod/templates/poddisruptionbudget.yaml @@ -1,5 +1,9 @@ {{- if .Values.global.defaultPodDisruptionBudget.enabled }} +{{- if (semverCompare ">=1.21-0" .Capabilities.KubeVersion.GitVersion) }} +apiVersion: policy/v1 +{{- else }} apiVersion: policy/v1beta1 +{{- end }} kind: PodDisruptionBudget metadata: name: istiod{{- if not (eq .Values.revision "") }}-{{ .Values.revision }}{{- end }} diff --git a/helm/istiod/values.yaml b/helm/istiod/values.yaml index 80ac6591d3..74e4283a89 100644 --- a/helm/istiod/values.yaml +++ b/helm/istiod/values.yaml @@ -2,7 +2,7 @@ ## Discovery Settings pilot: - autoscaleEnabled: true + autoscaleEnabled: false autoscaleMin: 1 autoscaleMax: 5 replicaCount: 1 @@ -10,7 +10,7 @@ pilot: rollingMaxUnavailable: 25% hub: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress - tag: 1.12 + tag: 04cfef254aade907478c2b70cf576bb5eb310047 # Can be a full hub/image:tag image: pilot @@ -221,6 +221,9 @@ meshConfig: # No hurry to do this in 1.6, we're trying to prove the code. global: + # whether to use autoscaling/v2 template for HPA settings + # for internal usage only, not to be configured by users. + autoscalingv2API: true higressName: "higress-controller" higressNamespace: "higress-system" higressPort: "15051" @@ -229,7 +232,7 @@ global: # enable pod disruption budget for the control plane, which is used to # ensure Istio control plane components are gradually upgraded or recovered. defaultPodDisruptionBudget: - enabled: true + enabled: false # The values aren't mutable due to a current PodDisruptionBudget limitation # minAvailable: 1