如何使有问题的Pod脱机以进行故障排除 [英] how to take a problematic pod offline to troubleshoot

查看:50
本文介绍了如何使有问题的Pod脱机以进行故障排除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我有办法从负载均衡器中拔出一个有问题的节点来进行故障排除.但是,我如何才能停止使用吊舱进行故障排除.哪些工具或命令可以做到?

HI I know there's a way i can pull out a problematic node out of loadbalancer to troubleshoot. But how can i pull a pod out of service to troubleshoot. What tools or command can do it ?

推荐答案

如Oreilly的"Kubernetes食谱:维护和故障排除"中所述此处的页面

As mentioned in Oreilly's "Kubernetes recipes: Maintenance and troubleshooting" page here

从服务中删除Pod

问题

Problem

您有一个由几个人支持的定义明确的服务(请参阅不可用) 豆荚.但是其中一个Pod行为异常,您想采取 将其从端点列表中删除,以便以后进行检查.

You have a well-defined service (see not available) backed by several pods. But one of the pods is misbehaving, and you would like to take it out of the list of endpoints to examine it at a later time.

解决方案

Solution

使用--overwrite选项重新标记广告连播,这将使您能够 更改容器上运行标签的值.通过覆盖这个 标签,可以确保服务不会选择该标签 选择器(不可用),将从列表中删除 端点.同时,副本集监视着您的吊舱 会看到豆荚消失了,并会开始一个新的副本.

Relabel the pod using the --overwrite option—this will allow you to change the value of the run label on the pod. By overwriting this label, you can ensure that it will not be selected by the service selector (not available) and will be removed from the list of endpoints. At the same time, the replica set watching over your pods will see that a pod has disappeared and will start a new replica.

要查看实际操作,请从简单的部署开始 用kubectl运行生成(请参见不可用):

To see this in action, start with a straightforward deployment generated with kubectl run (see not available):

对于命令,请检查上面提到的食谱页面.还有一节讨论调试豆荚",这将对您有帮助

For commands, check the recipes page mentioned above. There is also a section talking about "Debugging Pods" which will be helpful

这篇关于如何使有问题的Pod脱机以进行故障排除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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