<p>I am new to movetokube tool. I am struggling to understand how the move2kube collect command works. The <a href="https://move2kube.konveyor.io/" rel="nofollow noreferrer">web site</a> doesn't have any documentation on this command which is very surprising. I want to get all the applications installed in the Cloud Foundary cluster and I hope move2kube does this through move2kube collect command (or not?). I am not sure sure whether I have to execute the move2kube command on the Cloud Foundary cluster or K8 cluster. Please help!</p>
<p>I am executing the following move2kube command on a CF cluster</p>
<blockquote>
<p>move2kube collect</p>
</blockquote>
<p>I see the following error</p>
<pre><code>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: &quot;Get \&quot;https://cluster02.someserver.com:8443/api?timeout=32s\&quot;: failed to refresh token: oauth2: cannot fetch token: 401 \nResponse: {\&quot;error\&quot;:\&quot;unauthorized\&quot;,\&quot;error_description\&quot;:\&quot;Bad credentials\&quot;}&quot; . 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: &quot;exit status 1&quot;
WARN[0001] [*collector.ClusterCollector] failed. Error: &quot;exit status 1&quot;
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: &quot;exit status 1&quot;
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.
</code></pre>

KurioZ7
<p>From <a href="https://github.com/konveyor/move2kube/blob/main/USAGE.md#usage" rel="nofollow noreferrer">the move2kube GitHub page</a>:</p>
<blockquote>
<p><strong>Usage</strong></p>
<p><strong>One step Simple approach</strong></p>
<p><code>move2kube transform -s src</code></p>
<p><strong>Two step involved approach</strong></p>
<ol>
<li><em>Plan</em> : Place source code in a directory say
<code>src</code> and generate a plan. For example, you can use the <code>samples</code>
directory. <code>move2kube plan -s src</code></li>
<li><em>Transform</em> : In the same directory,
invoke the below command. <code>move2kube transform</code></li>
</ol>
<p>Note: If information about any runtime instance say cloud foundry or kubernetes cluster
needs to be collected use <code>move2kube collect</code>. You can place the
collected data in the <code>src</code> directory used in the plan.</p>
</blockquote>
<p>And from <a href="https://ashokponkumar.medium.com/introducing-konveyor-move2kube-f3b28e78cd22" rel="nofollow noreferrer">the article <strong>Introducing Konveyor Move2Kube</strong> on Medium</a>:</p>
<blockquote>
<p><strong>Move2Kube Usage</strong></p>
<p>Move2Kube takes as input the source artifacts and
outputs the target deployment artifacts.</p>
<p>Move2Kube accomplishes the
above activities using a 3 step approach of</p>
<ol>
<li><em>Collect</em> : If runtime
inspection is required, <code>move2kube collect</code> will analyse your runtime
environment such as cloud foundry or kubernetes, extract the required
metadata and output them as yaml files in <code>m2k_collect</code> folder.</li>
</ol>
<p>...</p>
</blockquote>
