aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/sdc/components/sdc-wfd-fe/templates/autoscaling.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/sdc/components/sdc-wfd-fe/templates/autoscaling.yaml')
-rw-r--r--kubernetes/sdc/components/sdc-wfd-fe/templates/autoscaling.yaml32
1 files changed, 32 insertions, 0 deletions
diff --git a/kubernetes/sdc/components/sdc-wfd-fe/templates/autoscaling.yaml b/kubernetes/sdc/components/sdc-wfd-fe/templates/autoscaling.yaml
new file mode 100644
index 0000000000..b7f265319b
--- /dev/null
+++ b/kubernetes/sdc/components/sdc-wfd-fe/templates/autoscaling.yaml
@@ -0,0 +1,32 @@
+{{- if .Values.autoscaling.enabled }}
+apiVersion: autoscaling/v2
+kind: HorizontalPodAutoscaler
+metadata:
+ name: {{ include "common.fullname" . }}
+ namespace: {{ include "common.namespace" . }}
+ labels: {{- include "common.labels" . | nindent 4 }}
+spec:
+ scaleTargetRef:
+ apiVersion: apps/v1
+ kind: Deployment
+ name: {{ include "common.fullname" . }}
+ minReplicas: {{ .Values.autoscaling.minReplicas }}
+ maxReplicas: {{ .Values.autoscaling.maxReplicas }}
+ metrics:
+ {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
+ - type: Resource
+ resource:
+ name: cpu
+ target:
+ type: Utilization
+ averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
+ {{- end }}
+ {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
+ - type: Resource
+ resource:
+ name: memory
+ target:
+ type: Utilization
+ averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
+ {{- end }}
+{{- end }}