apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: kafka-external-autoscaler
  namespace: myproject
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: consumer1-topic0001-group-0001
  minReplicas: 1
  maxReplicas: 40
  # For a full list of metrics supported run:
  #   $ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1" | jq -r ".resources[].name"
  metrics:
  - type: External
    external:
      metricName: "federatorai_recommendation"
      metricSelector:
        matchLabels:
          resource: replicas
          kubernetes_cluster_name: a82470be-f56c-4099-8bfa-723a42aec7a2
          kubernetes_namespace_name: myproject
          kubernetes_deployment_name: consumer1-topic0001-group-0001
      targetAverageValue: 1
