clearml-helm-charts/charts/clearml-serving/templates/clearml-serving-inference-hpa.yaml
Valeriano Manassero cbc1239d10
Serving 1.0.0 refactoring (#189)
* Changed: use dep charts

* Changed: improved ingresses

* Changed: naming management

* Fixed: naming

* Fixed: disable kubestats for prom

* Added: dependencies

* Fixed: typos
2023-03-20 11:49:42 +01:00

43 lines
1.7 KiB
YAML

{{- if .Values.clearml_serving_inference.autoscaling.enabled }}
apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "clearmlServing.fullname" . }}-inference-hpa
namespace: {{ .Release.Namespace | quote }}
annotations: {}
labels:
clearml.serving.service: {{ include "clearmlServing.fullname" . }}-inference
spec:
scaleTargetRef:
apiVersion: "apps/v1"
kind: Deployment
name: {{ include "clearmlServing.fullname" . }}-inference
minReplicas: {{ .Values.clearml_serving_inference.autoscaling.minReplicas }}
maxReplicas: {{ .Values.clearml_serving_inference.autoscaling.maxReplicas }}
metrics:
{{- if .Values.clearml_serving_inference.autoscaling.targetCPU }}
- type: Resource
resource:
name: cpu
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
targetAverageUtilization: {{ .Values.clearml_serving_inference.autoscaling.targetCPU }}
{{- else }}
target:
type: Utilization
averageUtilization: {{ .Values.clearml_serving_inference.autoscaling.targetCPU }}
{{- end }}
{{- end }}
{{- if .Values.clearml_serving_inference.autoscaling.targetMemory }}
- type: Resource
resource:
name: memory
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
targetAverageUtilization: {{ .Values.clearml_serving_inference.autoscaling.targetMemory }}
{{- else }}
target:
type: Utilization
averageUtilization: {{ .Values.clearml_serving_inference.autoscaling.targetMemory }}
{{- end }}
{{- end }}
{{- end }}