0
点赞
收藏
分享

微信扫一扫

[未完善]-k8s中的定时扩缩容

木樨点点 2022-04-13 阅读 54
运维

导语:每天定时扩缩容deployment的个数

apiVersion: batch/v2alpha1
kind: CronJob
metadata:
  name: scale-up
spec:
  schedule: "0 8 * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: scale
            image: siji/kubectl:v1.5.2
            command:
            - kubectl.sh
            - kubectl
            - scale
            - --replicas=3
            - deployment/nginx
          restartPolicy: OnFailure

可参考阿里的controller

https://github.com/AliyunContainerService/kubernetes-cronhpa-controller?spm=a2c63.p38356.0.0.203a479dOFUYx0

其他资料

https://github.com/kubernetes/kubernetes/issues/50569

https://blog.csdn.net/weixin_33807284/article/details/92414291

举报

相关推荐

0 条评论