apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: stream-hpa
  namespace: default
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: stream-deployment
  minReplicas: 1
  maxReplicas: 5
  metrics:
    - type: Pods
      pods:
        metricName: users
        targetAverageValue: 5