Created
January 7, 2019 13:59
-
-
Save mdesanti/7c61a350d0c40fa8a8c55e534adb2813 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{- if .Values.hpa.enabled -}} | |
apiVersion: autoscaling/v2beta1 | |
kind: HorizontalPodAutoscaler | |
metadata: | |
name: {{ .Release.Name }} | |
labels: | |
app: {{ template "podinfo.name" . }} | |
spec: | |
scaleTargetRef: | |
apiVersion: apps/v1beta2 | |
kind: Deployment | |
name: {{ .Release.Name }} | |
minReplicas: {{ .Values.replicaCount }} | |
maxReplicas: {{ .Values.hpa.maxReplicas }} | |
metrics: | |
{{- if .Values.hpa.cpu }} | |
- type: Resource | |
resource: | |
name: cpu | |
targetAverageUtilization: {{ .Values.hpa.cpu }} | |
{{- end }} | |
{{- if .Values.hpa.memory }} | |
- type: Resource | |
resource: | |
name: memory | |
targetAverageValue: {{ .Values.hpa.memory }} | |
{{- end }} | |
{{- if .Values.hpa.requests }} | |
- type: Pod | |
pods: | |
metricName: http_requests | |
targetAverageValue: {{ .Values.hpa.requests }} | |
{{- end }} | |
{{- end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment