列出正在为服务提供服务的Pod [英] List pods that are servicing a service

查看:92
本文介绍了列出正在为服务提供服务的Pod的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取服务特定服务的广告连播列表

I am trying to get the list of pods that are servicing a particular service

有3个与我的服务相关联的广告连播.

There are 3 pods associated with my service.

我试图执行以下命令

oc describe svc my-svc-1

我希望看到与此服务相关联的广告连播.但这并没有出现.什么命令使我仅获得与该服务相关联的Pod列表.

I am expecting to see the pods associated with this service. but that does not show up. What command gets me just the list of pods associated with the service.

推荐答案

服务使用选择器选择容器.查看服务的选择器,然后使用该选择器获取容器.对于kubectl,该命令如下所示:

A service chooses the pods using the selector. Look at the selector for the service, and get the pods using that selector. For kubectl, the command looks like:

kubectl get pods --selector <selector>

这篇关于列出正在为服务提供服务的Pod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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