J release changes
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / kong / templates / hpa.yaml
1 {{- if .Values.autoscaling.enabled }}
2 apiVersion: {{ include "kong.autoscalingVersion" . }}
3 kind: HorizontalPodAutoscaler
4 metadata:
5   name: "{{ template "kong.fullname" . }}"
6   namespace:  {{ template "kong.namespace" . }}
7   labels:
8     {{- include "kong.metaLabels" . | nindent 4 }}
9 spec:
10   scaleTargetRef:
11     apiVersion: apps/v1
12     kind: Deployment
13     name: "{{ template "kong.fullname" . }}"
14   minReplicas: {{ .Values.autoscaling.minReplicas }}
15   maxReplicas: {{ .Values.autoscaling.maxReplicas }}
16   {{- if .Values.autoscaling.behavior }}
17   behavior:
18     {{- toYaml .Values.autoscaling.behavior | nindent 4 }}
19   {{- end }}
20   {{- if contains "autoscaling/v2" (include "kong.autoscalingVersion" . ) }}
21   metrics:
22     {{- toYaml .Values.autoscaling.metrics | nindent 4 }}
23   {{- else }}
24   targetCPUUtilizationPercentage: {{ .Values.autoscaling.targetCPUUtilizationPercentage | default 80 }}
25   {{- end }}
26 {{- end }}