{{- if .Values.hpa.enabled -}}
apiVersion: {{ .Values.hpa.apiVersion }}
kind: HorizontalPodAutoscaler
metadata:
  name: {{ include "OpenMetadata.fullname" . }}-hpa
  labels:
    {{- include "OpenMetadata.labels" . | indent 4 }}
  {{- with .Values.podAnnotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: {{ include "OpenMetadata.fullname" . }}
  minReplicas: {{ .Values.hpa.minReplicas }}
  maxReplicas: {{ .Values.hpa.maxReplicas }}
  {{- with .Values.hpa.behavior }}
  behavior:
    {{- toYaml . | nindent 4 }}
  {{- end }}
  metrics:
    {{- toYaml .Values.hpa.metrics | nindent 4 }}
{{- end }}
