Skip to content

Latest commit

 

History

History
38 lines (34 loc) · 577 Bytes

chapter_6_3_hpa.md

File metadata and controls

38 lines (34 loc) · 577 Bytes

Horizontal Pod Autoscaler

apiVersion: apps/v1
kind: Deployment
metadata:
  name: test-nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: test-nginx
  template:
    metadata:
      labels:
        app: test-nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.26
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: test-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: test-nginx
  minReplicas: 1
  maxReplicas: 10
  targetCPUUtilizationPercentage: 10