---
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: learn
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: learn
  minReplicas: 1
  maxReplicas: 5
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 80
    - type: Resource
      resource:
        name: memory
        target:
          type: AverageValue
          averageValue: 50Mi
    # - type: Object
    #   object:
    #     metric:
    #       name: requests-per-second
    #     describedObject:
    #       apiVersion: networking.k8s.io/v1beta1
    #       kind: Ingress
    #       name: learn
    #     target:
    #       type: Value
    #       value: 0.5k
