mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 12:47:28 +08:00
feat: Remove redundant helm charts and add console as a dependency (#223)
This commit is contained in:
55
helm/core/templates/hpa.yaml
Normal file
55
helm/core/templates/hpa.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
{{- if .Values.gateway.autoscaling.enabled }}
|
||||
{{- if not .Values.global.autoscalingv2API }}
|
||||
apiVersion: autoscaling/v2beta1
|
||||
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:
|
||||
- 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:
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.gateway.autoscaling.targetCPUUtilizationPercentage }}
|
||||
---
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user