<p>Why do I have to use <code>--verb=list</code> option when I list all resources in the k8s namespace?</p>
<p>I read <a href="https://stackoverflow.com/questions/47691479/listing-all-resources-in-a-namespace">this question</a> and linked GitHub issue, and they worked for me. However, I cannot understand why <code>--verb=list</code> option is used.</p>
<p>Thanks to the help, I now know what this option does. When I add this option, the command shows only resources which support list verb. However, I could not figure out why it was necessary to show only the resources that support the list verb.</p>
<p>Please teach me this.</p>

<p>The question you quoted was to list resources. To be able to list, the resource must support the listing. Based on <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/#resource-types" rel="nofollow noreferrer">official documentation</a>:</p>
<pre><code>kubectl api-resources --verbs=list,get       # All resources that support the &quot;list&quot; and &quot;get&quot; request verbs
</code></pre>
<p>In the case of documentation, we have 2 verbs (list, get), you had one (list). The idea is for the command to return only those api-resources which handle <a href="https://www.oreilly.com/library/view/kubernetes-security/9781492039075/ch04.html" rel="nofollow noreferrer">list verb</a>.</p>
<p>In conclusion, the <code>--verb=list</code> flag was used to limit the results to only those that support the listing.</p>
<blockquote>
<p>I could not figure out why it was necessary to show only the resources that support the list verb.</p>
</blockquote>
<p>This solution is good if, for example, later you want to work on api-resources using only the list. If you would like to operate on a resource that does not support it, you will get an error similar to this:</p>
<pre><code>kubectl list tokenreviews
error: unknown command &quot;list&quot; for &quot;kubectl&quot;

Did you mean this?
        get
        wait
</code></pre>
<p>To avoid this situation you can filter results before with the flag <code>--verb=list</code>.</p>
