---
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: aloha-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: aloha-deployment
  minReplicas: 2
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      targetAverageUtilization: 80
  - type: Resource
    resource:
      name: memory
      targetAverageValue: 200Mi


# 
# apiVersion: autoscaling/v2beta2
# kind: HorizontalPodAutoscaler
# metadata:
#   name: myapp-hpa
#   namespace: default
# spec:
#   minReplicas: 1
#   maxReplicas: 3
#   metrics:
#   - resource:
#       name: cpu
#       target:
#         averageUtilization: 70
#         type: Utilization
#     type: Resource
#   - resource:
#       name: memory
#       target:
#         averageUtilization: 70
#         type: Utilization
#     type: Resource
#   scaleTargetRef:
#     apiVersion: extensions/v1beta1
#     kind: Deployment
#     name: myapp
