光辉岁月

k8s hpa 自动扩容

命令行操作

kubectl autoscale deployment zeus-deployment --cpu-percent=20 --min=1 --max=3

yaml 文件

apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: zeus
  namespace: default
spec:
  scaleTargetRef:               
    apiVersion: apps/v1
    kind: Deployment   
    name: zeus-deployment
  minReplicas: 1                
  maxReplicas: 3
  targetCPUUtilizationPercentage: 50  
posted @ 2020-04-26 18:18  taiman  阅读(802)  评论(0)    收藏  举报
哈哈哈