apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: k8s-demo-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: k8s-demo-deployment
  minReplicas: 6
  maxReplicas: 12
  metrics:
  - type: Resource
    resource:
      name: cpu
      targetAverageUtilization: 3
  - type: Resource
    resource:
      name: memory
      targetAverageValue: 300Mi
