[英]How do we ensure scale in protection for kubernetes pods?
While scaling-in, HPA shouldn't terminate a pod that has a job running on it.在扩展时,HPA 不应终止有作业在其上运行的 Pod。 This is taken care of by AWS autoscaling groups in the form of scale-in protection for instances.这由 AWS 自动扩展组以实例的缩减保护形式处理。 Is there something similar in kubernetes? Kubernetes 中有类似的东西吗?
You use terminationGracePeriodSeconds to make your worker process wait until it is done.您使用 terminateGracePeriodSeconds 使您的工作进程等待,直到它完成。 It will get a SIGTERM, then has that many seconds to finish (default 9 but you can make it anything, some of my workers have it set to 12 hours), then SIGKILL if it hasn't exited.它将得到一个 SIGTERM,然后有那么多秒来完成(默认为 9 但你可以做任何事情,我的一些工作人员将它设置为 12 小时),然后 SIGKILL 如果它没有退出。 So stop accepting new work units on SIGTERM, set the threshold to be the length of your longest work unit, and no worries :)所以停止在 SIGTERM 上接受新的工作单元,将阈值设置为你最长的工作单元的长度,不用担心:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.