大网数据广告活动
服务器运维问答

What happens when a pod fails for readiness health check?

· 52CE 我爱测

I was tracking down an unknown timeout problem in our cluster and found something interesting. We currently have 30 pods for a service. When I run kubectl get event Those 30 pods have been failing for readiness. All of them have …

问题原文

原帖链接 · Moon · CC BY-SA 4.0

I was tracking down an unknown timeout problem in our cluster and found something interesting.

We currently have 30 pods for a service. When I run kubectl get event Those 30 pods have been failing for readiness. All of them have "LASTSEEN" less than 10 mins and they are keep failing.

However, I can still access the service without a problem.

I thought Kube removes those pods that failed readiness from being accessed.

Why can I still access the service? I've doubled checked that every single one of them are still failing every 10 minutes or so.

已采纳解答

原帖链接 · Nepomucen · CC BY-SA 4.0

Answering first your main question in the title.

Quoting the official documentation on readiness probe concept

A pod with containers reporting that they are not ready does not receive traffic through Kubernetes Services.

or after blog post, which explains very well main differences between liveness or readiness probes

When readiness probes fail, Kubernetes will not send traffic to a pod until the probe is successful.

Now on the reason why you still can access your service. I assume you have some Deployment object, that controls your application instances` life cycle. Please note, when updating a deployment, it will also leave old replica(s) running until probes have been successful on new replica. That means that if your new pods are broken in some way, they’ll never see traffic, your old pods will continue to serve all traffic for the deployment.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-12-10)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。