<p>There is only 1 version per object in k8s 1.20 as can be checked by command:</p>
<pre><code>kubectl api-resources
</code></pre>
<p>Also, creating custom objects with different versions is not allowed. <code>AlreadyExists</code> is thrown on trying.</p>
<p>In what use cases providing <code>--api-version</code> option is useful then?</p>

Grzegorz Wilanowski
<p>Command:</p>
<pre class="lang-yaml prettyprint-override"><code>kubectl api-resources
</code></pre>
<p>Print the supported API resources on the server. You can read more about this command and allowed options <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#api-resources" rel="nofollow noreferrer">here</a>. Supported flags are:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Name</th>
<th>Shorthand</th>
<th>Default</th>
<th>Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td>api-group</td>
<td></td>
<td></td>
<td>Limit to resources in the specified API group.</td>
</tr>
<tr>
<td>cached</td>
<td></td>
<td>false</td>
<td>Use the cached list of resources if available.</td>
</tr>
<tr>
<td>namespaced</td>
<td></td>
<td>true</td>
<td>If false, non-namespaced resources will be returned, otherwise returning namespaced resources by default.</td>
</tr>
<tr>
<td>no-headers</td>
<td></td>
<td>false</td>
<td>When using the default or custom-column output format, don't print headers (default print headers).</td>
</tr>
<tr>
<td>output</td>
<td>o</td>
<td></td>
<td>Output format. One of: wide</td>
</tr>
<tr>
<td>sort-by</td>
<td></td>
<td></td>
<td>If non-empty, sort list of resources using specified field. The field can be either 'name' or 'kind'.</td>
</tr>
<tr>
<td>verbs</td>
<td></td>
<td>[]</td>
<td>Limit to resources that support the specified verbs.</td>
</tr>
</tbody>
</table>
</div>
<p>You can use <code>--api-group</code> option to limit to resources in the specified API group.</p>
<p>There also exist the command:</p>
<pre><code>kubectl api-versions
</code></pre>
<p>and it prints the supported API versions on the server, in the form of &quot;group/version&quot;. You can read more about it <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#api-versions" rel="nofollow noreferrer">here</a>.</p>
<p>You can also read more about <a href="https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning" rel="nofollow noreferrer">API groups and versioning</a>.</p>
<p><strong>EDIT:</strong>
In the comment:</p>
<blockquote>
<p>No, see example &quot;kubectl explain deployment --api-version v1&quot;. In other words: when there can be more then one api version of a resource?</p>
</blockquote>
<p>you are referring to a completely different command which is <code>kubectl explain</code>. Option <code>--api-version</code> gets different explanations for particular API version (API group/version). You can read more about it <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#explain" rel="nofollow noreferrer">here</a>.</p>
