hpa.yaml 900 B

12345678910111213141516171819202122232425262728293031
  1. {{- if and .Values.deployment.enabled .Values.deployment.autoscaling.enabled }}
  2. apiVersion: autoscaling/v2beta1
  3. kind: HorizontalPodAutoscaler
  4. metadata:
  5. name: {{ include "promtail.fullname" . }}
  6. namespace: {{ include "promtail.namespaceName" . }}
  7. labels:
  8. {{- include "promtail.labels" . | nindent 4 }}
  9. spec:
  10. scaleTargetRef:
  11. apiVersion: apps/v1
  12. kind: Deployment
  13. name: {{ include "promtail.fullname" . }}
  14. {{- with .Values.deployment.autoscaling }}
  15. minReplicas: {{ .minReplicas }}
  16. maxReplicas: {{ .maxReplicas }}
  17. metrics:
  18. {{- with .targetCPUUtilizationPercentage }}
  19. - type: Resource
  20. resource:
  21. name: cpu
  22. targetAverageUtilization: {{ . }}
  23. {{- end }}
  24. {{- with .targetMemoryUtilizationPercentage }}
  25. - type: Resource
  26. resource:
  27. name: memory
  28. targetAverageUtilization: {{ . }}
  29. {{- end }}
  30. {{- end }}
  31. {{- end }}