# apiVersion: autoscaling/v2beta1
# kind: HorizontalPodAutoscaler
# metadata:
#   name: nginx-custom-hpa
# spec:
#   scaleTargetRef:
#     apiVersion: apps/v1
#     kind: Deployment
#     name: nginx-deployment
#   minReplicas: 1
#   maxReplicas: 10
#   metrics:
#   - type: Pods
#     pods:
#       metricName: nginx_server_connections
#       targetAverageValue: 4
---
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: socket-hpa
  namespace: demo
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: socket
  minReplicas: 2
  maxReplicas: 10
  metrics:
  - type: Pods
    pods:
      metricName: socket_io_connected
      targetAverageValue: 20