导语:每天定时扩缩容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