slaventius 2 years ago
parent 0567e35cf8
commit e115a797c5
  1. 46
      deploy/helm/templates/hpa.yaml

@ -1,21 +1,39 @@
apiVersion: autoscaling/v1 # apiVersion: autoscaling/v1
# kind: HorizontalPodAutoscaler
# metadata:
# name: {{ .Release.Name }}-hpa
# spec:
# scaleTargetRef:
# apiVersion: apps/v1
# kind: Deployment
# name: {{ .Release.Name }}-hpa
# minReplicas: 1
# maxReplicas: 5
# targetCPUUtilizationPercentage: 20
# # metrics:
# # - type: Resource
# # resource:
# # name: cpu
# # targetAverageUtilization: 80
# # - type: Resource
# # resource:
# # name: memory
# # targetAverageValue: 200Mi
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler kind: HorizontalPodAutoscaler
metadata: metadata:
name: {{ .Release.Name }}-hpa name: {{ .Release.Name }}-hpa
spec: spec:
minReplicas: 1
maxReplicas: 5
metrics:
- resource:
name: cpu
target:
averageUtilization: 50
type: Utilization
type: Resource
scaleTargetRef: scaleTargetRef:
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
name: {{ .Release.Name }}-hpa name: {{ .Release.Name }}-application
minReplicas: 1
maxReplicas: 5
targetCPUUtilizationPercentage: 20
# metrics:
# - type: Resource
# resource:
# name: cpu
# targetAverageUtilization: 80
# - type: Resource
# resource:
# name: memory
# targetAverageValue: 200Mi

Loading…
Cancel
Save