如何使用"move2kube collect"命令?

How to use "move2kube collect" command?

我是 movetokube 工具的新手。我很难理解 move2kube collect 命令的工作原理。 web site 没有关于此命令的任何文档,这是非常令人惊讶的。我想获取安装在 Cloud Foundary 集群中的所有应用程序,我希望 move2kube 通过 move2kube collect 命令(或不?)做到这一点。我不确定是否必须在 Cloud Foundary 集群或 K8 集群上执行 move2kube 命令。请帮忙!

我正在 CF 集群上执行以下 move2kube 命令

move2kube collect

我看到以下错误

INFO[0000] Begin collection
INFO[0000] [*collector.ClusterCollector] Begin collection
WARN[0001] Error while fetching storage classes using command [/usr/local/bin/kubectl get sc -o yaml]
ERRO[0001] API request for server-group list failed
WARN[0001] Failed to retrieve preferred group information from cluster
WARN[0001] Failed to collect using the API. Error: "Get \"https://cluster02.someserver.com:8443/api?timeout=32s\": failed to refresh token: oauth2: cannot fetch token: 401 \nResponse: {\"error\":\"unauthorized\",\"error_description\":\"Bad credentials\"}" . Falling back to using the CLI.
ERRO[0001] Error while running kubectl api-resources: exit status 1
WARN[0001] Failed to collect using the CLI. Error: "exit status 1"
WARN[0001] [*collector.ClusterCollector] failed. Error: "exit status 1"
INFO[0001] [*collector.ImagesCollector] Begin collection
INFO[0001] [*collector.ImagesCollector] Done
INFO[0001] [*collector.CFContainerTypesCollector] Begin collection
WARN[0002] Error while getting buildpacks : exit status 1
WARN[0002] Unable to collect buildpacks from cf instance : exit status 1
ERRO[0002] exit status 1
WARN[0002] Unable to find used buildpacks : exit status 1
INFO[0004] [*collector.CFContainerTypesCollector] Done
INFO[0004] [*collector.CfAppsCollector] Begin collection
ERRO[0004] exit status 1
WARN[0004] [*collector.CfAppsCollector] failed. Error: "exit status 1"
INFO[0004] Collection done
INFO[0004] Collect Output in [/home/mytest/move2kube/samples/m2k_collect]. Copy this directory into the source directory to be used for planning.

来自 the move2kube GitHub page:

Usage

One step Simple approach

move2kube transform -s src

Two step involved approach

  1. Plan : Place source code in a directory say src and generate a plan. For example, you can use the samples directory. move2kube plan -s src
  2. Transform : In the same directory, invoke the below command. move2kube transform

Note: If information about any runtime instance say cloud foundry or kubernetes cluster needs to be collected use move2kube collect. You can place the collected data in the src directory used in the plan.

来自the article Introducing Konveyor Move2Kube on Medium

Move2Kube Usage

Move2Kube takes as input the source artifacts and outputs the target deployment artifacts.

Move2Kube accomplishes the above activities using a 3 step approach of

  1. Collect : If runtime inspection is required, move2kube collect will analyse your runtime environment such as cloud foundry or kubernetes, extract the required metadata and output them as yaml files in m2k_collect folder.

...