apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: ingress-metrics-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1beta2
    kind: Deployment
    name: autoscaler-metrics-demo
  minReplicas: 2
  maxReplicas: 50
  metrics:
    - type: External
      external:
        metric:
          name: sls_ingress_latency_p99
          selector:
            matchLabels:
              sls.project: "k8s-log-ce4e2104fd10e4cd68ce21c40c28805e8"
              sls.logstore: "nginx-ingress"
              sls.ingress.route: "autoscaler-autoscaler-metrics-service-8080"  #namespace-svc-port
        target:
          type: Value
          averageValue: 10  #ms