From 4fdfcb80bdeb6dea5e6d449b7ae229cd51ecaedb Mon Sep 17 00:00:00 2001 From: Naseem Ullah Date: Fri, 11 Jan 2019 10:28:39 -0500 Subject: [PATCH] use specific hpa in favor of generic autoscaling for hpa values Signed-off-by: Naseem Ullah --- pkg/chartutil/create.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/chartutil/create.go b/pkg/chartutil/create.go index 8a09a4bea..90e1b5122 100644 --- a/pkg/chartutil/create.go +++ b/pkg/chartutil/create.go @@ -289,22 +289,24 @@ spec: apiVersion: apps/v1 kind: Deployment name: {{ template ".fullname" . }} - minReplicas: {{ .Values.hpa.minReplicas }} - maxReplicas: {{ .Values.hpa.maxReplicas }} +{{- with .Values.deployment.hpa }} + minReplicas: {{ .minReplicas }} + maxReplicas: {{ .maxReplicas }} metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- if .targetCPUUtilizationPercentage }} - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.hpa.targetCPUUtilizationPercentage }} + targetAverageUtilization: {{ .targetCPUUtilizationPercentage }} {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- if .targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.hpa.targetMemoryUtilizationPercentage }} + targetAverageUtilization: {{ .targetMemoryUtilizationPercentage }} {{- end }} {{- end }} +{{- end }} ` const defaultService = `apiVersion: v1