Skip to content

Commit

Permalink
Update hpa.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
limz8319 authored Jun 13, 2023
1 parent 4131023 commit f361910
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions charts/bluegreen/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "bulegreen.fullname" . }}
name: {{ include "website.fullname" . }}
labels:
{{- include "bulegreen.labels" . | nindent 4 }}
{{- include "website.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "bulegreen.fullname" . }}
name: {{ include "website.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
target:
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
type: Utilization
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
target:
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
type: Utilization
{{- end }}
{{- end }}

0 comments on commit f361910

Please sign in to comment.