<p>I would like to list all objects that are present in a specific namespace in kubernetes. </p>

<pre><code>kubectl get all -n &lt;namespace&gt;
</code></pre>

<p>the above command doesn't list all available objects from the given namespace. Is there a way to list them using kubectl?</p>

<p>i can list all objects that i want by passing them to kubectl. but i dont want that.</p>

<pre><code>kubectl -n &lt;namespace&gt; get deployment,rs,sts,ds,job,cronjobs -oyaml
</code></pre>

<p>First of all these following rules decide if the resource will be part of the <strong>all</strong> Category or not. </p>

<blockquote>
  <p>Here are the rules to add a new resource to the  <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-cli/kubectl-conventions.md#rules-for-extending-special-resource-alias---all" rel="nofollow noreferrer">kubectl get all</a> output.</p>
</blockquote>

<ul>
<li><p>No cluster scoped resources</p></li>
<li><p>No namespace admin level resources (limits, quota, policy,<br>
authorization rules)</p></li>
<li><p>No resources that are potentially unrecoverable (secrets and pvc)</p></li>
<li><p>Resources that are considered "similar" to #3 should be grouped the<br>
same (configmaps)</p></li>
</ul>

<p>To <strong>Answer your question</strong> This is taken from <a href="https://stackoverflow.com/questions/47691479/listing-all-resources-in-a-namespace">rcorre's Answer</a></p>

<pre><code>kubectl api-resources --verbs=list --namespaced -o name \
  | xargs -n 1 kubectl get --show-kind --ignore-not-found -l &lt;label&gt;=&lt;value&gt; -n &lt;namespace&gt;
</code></pre>

<p>Lastly, If you want to add a Custom Resource in <strong>all category</strong>, you need to provide these field in your CRD spec. <a href="https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#categories" rel="nofollow noreferrer">custom-resource-definitions:categories</a> </p>

<pre><code># categories is a list of grouped resources the custom resource belongs to.
    categories:
    - all

</code></pre>
