Kubernetes滚动更新是否可以从服务负载均衡器中正常删除Pod [英] Does a Kubernetes rolling-update gracefully remove pods from a service load balancer

查看:95
本文介绍了Kubernetes滚动更新是否可以从服务负载均衡器中正常删除Pod的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在负载均衡器后面滚动更新主机的标准做法是使主机正常旋转.可以通过将主机标记为不正常"并确保主机不再接收来自负载平衡器的请求来完成此操作.

Standard practice for a rolling update of hosts behind load balancer is to gracefully take the hosts out of rotation. This can be done by marking the host "un-healthy" and ensuring the host is no longer receiving requests from the load balancer.

Kubernetes是否对由ReplicationController管理并为LoadBalancer服务提供服务的Pod做类似的事情?

Does Kubernetes do something similar for pods managed by a ReplicationController and servicing a LoadBalancer Service?

即,Kubernetes是否将Pod从LoadBalancer轮换中移除,确保进入的流量已经消失,然后才发出Pod关闭的作用?

I.e., does Kubernetes take a pod out of the LoadBalancer rotation, ensure incoming traffic has died-down, and only then issue pod shutdown?

推荐答案

实际上,一旦删除了pod,它将一直处于终止"状态,直到被销毁为止(terminationGracePeriodSeconds之后),这意味着将其从服务负载中删除了.平衡器,但仍然能够满足现有请求.

Actually, once you delete the pod, it will be in "terminating" state until it is destroyed (after terminationGracePeriodSeconds) which means it is removed from the service load balancer, but still capable of serving existing requests.

我们还使用就绪"运行状况检查,并且preStop是同步的,因此您可以让preStop挂钩将Pod的就绪状态标记为false,然后等待将其从负载均衡器中删除. preStop挂钩出口.

We also use "readiness" health checks, and preStop is synchronous, so you could make your preStop hook mark the readiness of the pod to be false, and then wait for it to be removed from the load balancer, before having the preStop hook exit.

这篇关于Kubernetes滚动更新是否可以从服务负载均衡器中正常删除Pod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆