apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: postgres-tunnel
  namespace: postgres-tunnel
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: postgres-tunnel
  minReplicas: 2
  maxReplicas: 5
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 70
  behavior:
    scaleDown:
      stabilizationWindowSeconds: 300
