hpa.yaml 839 B

12345678910111213141516171819202122232425
  1. {{- if .Values.autoscaling.enabled }}
  2. apiVersion: autoscaling/v2beta1
  3. kind: HorizontalPodAutoscaler
  4. metadata:
  5. name: {{ template "grafana.fullname" . }}
  6. namespace: {{ template "grafana.namespace" . }}
  7. labels:
  8. app.kubernetes.io/name: {{ template "grafana.name" . }}
  9. helm.sh/chart: {{ template "grafana.chart" . }}
  10. app.kubernetes.io/managed-by: {{ .Release.Service }}
  11. app.kubernetes.io/instance: {{ .Release.Name }}
  12. spec:
  13. scaleTargetRef:
  14. apiVersion: apps/v1
  15. {{- if eq .Values.persistence.type "statefulset" }}
  16. kind: StatefulSet
  17. {{- else }}
  18. kind: Deployment
  19. {{- end }}
  20. name: {{ template "grafana.fullname" . }}
  21. minReplicas: {{ .Values.autoscaling.minReplicas }}
  22. maxReplicas: {{ .Values.autoscaling.maxReplicas }}
  23. metrics:
  24. {{ toYaml .Values.autoscaling.metrics | indent 4 }}
  25. {{- end }}