kube | hpa(작성중)

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: cpu-stress-hpa
  namespace: stress
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: cpu-stress
  minReplicas: 1
  maxReplicas: 5
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 70
  behavior:
    scaleUp:
      stabilizationWindowSeconds: 300
      selectPolicy: Max
      policies:
        - type: Pods
          value: 1
          periodSeconds: 30
    scaleDown:
      stabilizationWindowSeconds: 300
      selectPolicy: Max
      policies:
        - type: Pods
          value: 1
          periodSeconds: 30

apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: msa-fe-hpa
  namespace: msa-fe
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: msa-fe-dp
  minReplicas: 1 #Pod minSize
  maxReplicas: 5 #Pod MaxSize
  targetCPUUtilizationPercentage: 25
apiVersion: apps/v1
kind: Deployment
metadata:
  name: cpu-stress
  namespace: stress
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cpu-stress
  template:
    metadata:
      labels:
        app: cpu-stress
    spec:
      containers:
      - name: main
        image: python:3.10-slim
        command: ["sleep", "3600"]
        resources:
          requests:
            cpu: "100m"
          limits:
            cpu: "1000m"