diff --git a/shiny-server/templates/hpa.yaml b/shiny-server/templates/hpa.yaml index a91f61bd5c7faa1ca3da0eb6883ff7bc0f912431..97bee0ecd08b1ed30a1c288074af747a40617fee 100644 --- a/shiny-server/templates/hpa.yaml +++ b/shiny-server/templates/hpa.yaml @@ -1,4 +1,4 @@ -{{- if .Values.autoscaling.enabled }} +{{- if or (.Values.autoscaling.enabled) (lookup "autoscaling/v2" "HorizontalPodAutoscaler" .Release.Namespace (include "chart.fullname" .)) }} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: @@ -10,8 +10,13 @@ spec: apiVersion: apps/v1 kind: Deployment name: {{ include "chart.fullname" . }} + {{ if $.Values.autoscaling.enabled }} minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} + {{ else }} + minReplicas: 1 + maxReplicas: 1 + {{ end }} metrics: {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - type: Resource