k8s-basic/helm-chart/templates/hpa.yaml
Waylon S. Walker f8b377c347 init
2025-02-22 16:48:19 -06:00

25 lines
679 B
YAML

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Values.name }}
namespace: {{ .Values.namespace | default .Values.name }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Values.name }}
minReplicas: {{ .Values.minReplicas }}
maxReplicas: {{ .Values.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.targetCPUUtilization }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.targetMemoryUtilization }}