apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: products
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: products-backend
  minReplicas: 1
  maxReplicas: 10
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 50
    - type: Pods
      pods:
        metric:
          name: products_http_requests_total_per_second
        target:
          type: AverageValue
          averageValue: 100m