首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何通过kubectl获取多个服务的状态?

如何通过kubectl获取多个服务的状态?
EN

Stack Overflow用户
提问于 2019-10-09 16:40:28
回答 1查看 508关注 0票数 0

根据我对文档的理解,-R标志应该能做到这一点,但对我来说,命令kubectl rollout status -R -f k8s/services会失败,并返回error: rollout status is only supported on individual resources and resource collections - 3 resources were found

k8s/services目录中,我有3个服务清单。如果不是3个服务,那么错误消息中提到的资源集合是什么?使用-R时,目录中应该包含什么内容

kubectl rollout status --help

代码语言:javascript
复制
Show the status of the rollout.

 By default 'rollout status' will watch the status of the latest rollout until it's done. If you don't want to wait for
the rollout to finish then you can use --watch=false. Note that if a new rollout starts in-between, then 'rollout
status' will continue watching the latest revision. If you want to pin to a specific revision and abort if it is rolled
over by another revision, use --revision=N where N is the revision you need to watch for.

Examples:
  # Watch the rollout status of a deployment
  kubectl rollout status deployment/nginx

Options:
  -f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.
  -k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.
  -R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage
related manifests organized within the same directory.
      --revision=0: Pin to a specific revision for showing its status. Defaults to 0 (last revision).
      --timeout=0s: The length of time to wait before ending watch, zero means never. Any other values should contain a
corresponding time unit (e.g. 1s, 2m, 3h).
  -w, --watch=true: Watch the status of the rollout until it's done.

Usage:
  kubectl rollout status (TYPE NAME | TYPE/NAME) [flags] [options]

Use "kubectl options" for a list of global command-line options (applies to all commands).

我已经使用kubectl版本1.141.15进行了测试。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-10-09 16:46:04

这意味着它找到了3个服务,但您只能看到特定服务的转出状态。像这样:

kubectl rollout status -f k8s/services/<svc-name>.yaml

当所有yaml都是services的子级时,您不需要使用-R。

看看为什么要在这个issue中添加-R标志

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58300190

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档