简体   繁体   English

我们如何确保 kubernetes pod 的保护规模?

[英]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.

相关问题 Kubernetes:如何扩展我的 Pod - Kubernetes: how to scale my pods 多个副本/容器如何扩展Kubernetes? - How does multiple replicas/pods scale Kubernetes? 缩小 Kubernetes pod - Scale down Kubernetes pods 如何根据Pod的“就绪” /“未就绪”状态使Kubernetes扩展部署? - How do I make Kubernetes scale my deployment based on the “ready”/ “not ready” status of my Pods? 如何确保每个 kube.netes 节点运行 2 个或更多 pod? - How to ensure every kubernetes node running 2 or more pods? 我们如何正确分配 pod,以便 KFServing 可以将 GPU 实例缩减为零? - How do we assign pods properly so that KFServing can scale down GPU Instances to zero? 在 Airflow 中,我们如何将环境变量传递给 Kubernetes Executor worker pod? - In Airflow, how do we pass environment variables to Kubernetes Executor worker pods? Kubernetes 缩小特定的 pod - Kubernetes scale down specific pods 如何按计划自动缩小OpenShift / Kubernetes pod? - How to scale down OpenShift/Kubernetes pods automatically on a schedule? 如何将使用持久卷声明的 Kubernetes 部署扩展到 2 个 Pod? - How to scale a Kubernetes deployment which uses a Persistent Volume Claim to 2 Pods?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM