容器插件工具kubectl-images

容器插件工具

简单方便查找镜像源信息,kubectl-images
代码地址:https://github.com/chenjiandongx/kubectl-images

此工具可以快捷执行命令来查看集群内ns,pod,及镜像等信息;
查看帮助项

~ kubectl images --help
Show container images used in the cluster.

Usage:
  kubectl-images [podname-regex] [flags]

Examples:
  # display a table of all images in current namespace using podName/containerName/containerImage as columns.
  kubectl images

  # display images info in yaml format
  kubectl images -oy

  # display a table of images that match 'nginx' podname regex in 'dev' namespace using podName/containerImage as columns.
  kubectl images -n dev nginx -c 1,2

Flags:
  ## -A默认选择所有ns
  -A, --all-namespaces         if present, list images in all namespaces.
  ## -c参数选择输出的内容,可选有命名空间、pod名称、容器名、容器镜像、镜像拉取策略、镜像大小,对应数字012345,例:-c 1,2,3
  -c, --columns string         specify the columns to display, separated by comma. [0:Namespace, 1:PodName, 2:ContainerName, 3:ContainerImage, 4:ImagePullPolicy, 5:ImageSize] (default "1,2,3")
  -C, --context string         The name of the kubeconfig context to use.
  -h, --help                   help for kubectl-images
  -k, --kubeconfig string      path to the kubeconfig file to use for CLI requests.
  ## -n 指定ns名称
  -n, --namespace string       if present, list images in the specified namespace only. Use current namespace as fallback.
  ## -o参数可以设定输出的内容格式,例:-0 j 输出json格式内容
  -o, --output-format string   output format. [json(j)|table(t)|yaml(y)] (default "table")
  -u, --unique                 Unique images group by namespace/container/images/pullPolicy.
      --version                version for kubectl-images
使用示例
使用参数-n 指定ns,-c 指定需要的内容,-o 指定输出格式, “cbs”过滤名称含有此内容的容器
~ kubectl-images -n kube-system  -c 0,1,2,3 -o j cbs
[
 {
  "namespace": "kube-system",
  "pod": "csi-cbs-controller-******-mnvrh",
  "container": "csi-provisioner",
  "image": "ccr.ccs.tencentyun.com/tkeimages/csi-provisioner:v2.0.4"
 },
 {
  "namespace": "kube-system",
  "pod": "csi-cbs-controller-*****-mnvrh",
  "container": "csi-attacher",
  "image": "ccr.ccs.tencentyun.com/tkeimages/csi-attacher:v3.0.2"
 },

这个查看有windows版和linux版,都可以使用;
下载地址:
https://github.com/chenjiandongx/kubectl-images/releases
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Howei__

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值