apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: frontend
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: frontend
  minReplicas: 1
  maxReplicas: 20
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 50
# apiVersion: autoscaling/v1
# kind: HorizontalPodAutoscaler
# metadata:
#   name: frontend
# spec:
#   maxReplicas: 20
#   minReplicas: 1
#   targetCPUUtilizationPercentage: 50
#   scaleTargetRef:
#     apiVersion: apps/v1
#     kind: Deployment
#     name: frontend
