hpaV1.yaml 796 B

12345678910111213141516171819202122
  1. {{- if .Values.autoscaling.enabled }}
  2. {{- $apiVersions := .Capabilities.APIVersions -}}
  3. {{- if not ($apiVersions.Has "autoscaling/v2") }}
  4. apiVersion: autoscaling/v1
  5. kind: HorizontalPodAutoscaler
  6. metadata:
  7. name: {{ template "docker-registry.fullname" . }}
  8. labels:
  9. app: {{ template "docker-registry.name" . }}
  10. chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
  11. release: {{ .Release.Name }}
  12. heritage: {{ .Release.Service }}
  13. spec:
  14. scaleTargetRef:
  15. apiVersion: apps/v1
  16. kind: Deployment
  17. name: {{ template "docker-registry.fullname" . }}
  18. minReplicas: {{ .Values.autoscaling.minReplicas }}
  19. maxReplicas: {{ .Values.autoscaling.maxReplicas }}
  20. targetCPUUtilizationPercentage: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
  21. {{- end }}
  22. {{- end }}