hpa.yaml 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. {{- if and .Values.autoscaling.enabled (eq .Values.mode "deployment") }}
  2. apiVersion: autoscaling/v2
  3. kind: HorizontalPodAutoscaler
  4. metadata:
  5. name: {{ include "opentelemetry-collector.fullname" . }}
  6. labels:
  7. {{- include "opentelemetry-collector.labels" . | nindent 4 }}
  8. spec:
  9. scaleTargetRef:
  10. apiVersion: apps/v1
  11. kind: Deployment
  12. name: {{ include "opentelemetry-collector.fullname" . }}
  13. minReplicas: {{ .Values.autoscaling.minReplicas }}
  14. maxReplicas: {{ .Values.autoscaling.maxReplicas }}
  15. metrics:
  16. {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
  17. - type: Resource
  18. resource:
  19. name: memory
  20. target:
  21. type: Utilization
  22. averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
  23. {{- end }}
  24. {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
  25. - type: Resource
  26. resource:
  27. name: cpu
  28. target:
  29. type: Utilization
  30. averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
  31. {{- end }}
  32. {{- end }}