---
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: middle-manager-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: StatefulSet
    name: middle-manager
  minReplicas: 2
  maxReplicas: 4
  metrics:
  - type: Pods
    pods:
      metricName: druid_pending_tasks
      targetAverageValue: 2