简体   繁体   English

优雅终止kubernetes豆荚

[英]Graceful termination of kubernetes pods

We have an application with 4 pods running with a load balancer! 我们有一个应用程序,有4个pod与负载均衡器一起运行! We want to try the rolling update, but we are not sure what happens when a pod goes down! 我们想尝试滚动更新,但我们不确定当pod崩溃时会发生什么! The documentation is unclear! 文档不清楚! Particularly this quote from Termination Of Pods : 特别是来自Termination Of Pods的引用:

Pod is removed from endpoints list for service, and are no longer considered part of the set of running pods for replication controllers. Pod将从端点列表中删除以进行维护,并且不再被视为复制控制器的运行pod集的一部分。 Pods that shutdown slowly can continue to serve traffic as load balancers (like the service proxy) remove them from their rotations. 缓慢关闭的窗格可以继续为流量提供服务,因为负载平衡器(如服务代理)会将它们从旋转中移除。

So, if someone can guide us on the following questions : 因此,如果有人可以指导我们以下问题:

1.) When a pod is shutting down, can it still serve new requests? 1.)当一个pod正在关闭时,它是否还可以提供新的请求? Or does the load balancer not consider it? 或负载均衡器不考虑它?

2.) Does it complete the requests it is processing till the grace-period is exhausted? 2.)它是否完成了它正在处理的请求,直到宽限期用完为止? and then kills the container even if any process is still running? 然后即使任何进程仍在运行,也会杀死容器?

3.) Also, this mentions replication controllers, what we have is a Deployment and Deployment has replica sets, so will there be any difference? 3.)此外,这提到了复制控制器,我们所拥有的是部署和部署有副本集,那么会有什么区别吗?

We went through this question but the answers are conflicting without any source : 我们经历了这个问题,但答案是矛盾的,没有任何来源: Does a Kubernetes rolling-update gracefully remove pods from a service load balancer Kubernetes滚动更新是否从服务负载均衡器中正常删除了pod

1) when a Pod is shutting down it's state is changed to Terminating and it is not considered by the LoadBalancer - as described in the Pod termination docs 1)当Pod正在关闭时,它的状态将更改为Terminating ,LoadBalancer不会考虑它 - 如Pod终止文档中所述

2) Yes - you might want to look at the pod.Spec.TerminationGracePeriodSeconds configuration to gain some control. 2)是 - 您可能需要查看pod.Spec.TerminationGracePeriodSeconds配置以获得一些控制权。 You'll find details in the API documentation 您可以在API文档中找到详细信息

3) No - the ReplicaSet and the Deployment take care of scheduling Pods, there's no difference when it comes to the shutdown behaviour of the Pods 3)否 - ReplicaSet和Deployment负责调度Pods,在Pods的关闭行为方面没有区别

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM