aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/aai/components/aai-traversal/templates/autoscaling.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/aai/components/aai-traversal/templates/autoscaling.yaml')
-rw-r--r--kubernetes/aai/components/aai-traversal/templates/autoscaling.yaml29
1 files changed, 29 insertions, 0 deletions
diff --git a/kubernetes/aai/components/aai-traversal/templates/autoscaling.yaml b/kubernetes/aai/components/aai-traversal/templates/autoscaling.yaml
new file mode 100644
index 0000000000..a14a9b5bda
--- /dev/null
+++ b/kubernetes/aai/components/aai-traversal/templates/autoscaling.yaml
@@ -0,0 +1,29 @@
+{{- if .Values.autoscaling.enabled }}
+apiVersion: autoscaling/v2
+kind: HorizontalPodAutoscaler
+metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
+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 }}