华为云UCS-集群评估:kspider使用方法

时间:2024-05-08 17:06:49

kspider使用方法

kspider工具支持在Linux(x86、arm)和Windows环境中运行,使用方法相似。本文将以Linux(x86)环境为例进行介绍。

若使用Linux(arm)或Windows环境,请将下述命令中的kspider-linux-amd64分别替换为kspider-linux-arm64kspider-windows-amd64.exe

根据容器迁移准备工作章节的要求,准备一台服务器并上传kspider工具,然后进行解压缩。在kspider工具所在目录下执行./kspider-linux-amd64 -h,您可以查看该工具的使用方法。

  • -k, --kubeconfig:指定kubectl的KubeConfig位置,默认是$HOME/.kube/config。kubeConfig文件:用于配置对Kubernetes集群的访问,KubeConfig文件中包含访问注册Kubernetes集群所需要的认证凭据以及Endpoint(访问地址),详细介绍可参见Kubernetes文档
  • -n, --namespaces:指定采集的命名空间,默认排除了kube-system、kube-public、kube-node-lease等系统命名空间。
  • -q, --quiet:静态退出。
  • -s, --serial:根据采集信息输出汇聚文件(cluster-{serial}.json)和推荐文件(preferred-{serial}.json)唯一标识的序号。
$ ./kspider-linux-amd64 -h
A cluster information collection and recommendation tool implement by Go.

Usage:
  kspider [flags]

Aliases:
  kspider, kspider

Flags:
  -h, --help                help for kspider
  -k, --kubeconfig string   The kubeconfig of k8s cluster's. Default is the $HOME/.kube/config. (default "$HOME/.kube/config")
  -n, --namespaces string   Specify a namespace for information collection. If multiple namespaces are specified, separate them with commas (,), such as ns1,ns2. default("") is all namespaces
  -q, --quiet               command to execute silently
  -s, --serial string       User-defined sequence number of the execution. The default value is the time when the kspider is started. (default "1673853404")
support.huaweicloud.com/usermanual-ucs/ucs_01_0188.html