<p>Okay, the title is quite mouthful. But it's actually describing the situation.</p>
<p>I deployed a service on GKE in namespace argo-events. Something was wrong with it so I tore it down:</p>
<pre><code>kubectl delete namespace argo-events
</code></pre>
<p>Actually, that's already where the problems started (I suspect a connection to the problem described below) and I had to resort to a <a href="http://medium.com/@craignewtondev/how-to-fix-kubernetes-namespace-deleting-stuck-in-terminating-state-5ed75792647e" rel="nofollow noreferrer">hack</a> because argo-events got stuck in a Terminating state forever. But the result was as desired - namespace seemed to be gone together with all objects in it.</p>
<p>Because of problems with redeployment I inspected the GKE Object Browser (just looking around - cannot filter for argo-events namespace anymore as it is officially gone) where I stumbled upon two lingering objects in ns argo-events:</p>
<p><a href="https://i.stack.imgur.com/9wcNy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9wcNy.png" alt="enter image description here" /></a></p>
<p>argo-events is not listed by <code>kubectl get namespaces</code>. Just confirming that.</p>
<p>And I can find those two objects if I look them up specifically:</p>
<pre><code>$ kubectl get eventbus -n argo-events
NAME      AGE
default   17h

$ kubectl get eventsource -n argo-events
NAME                  AGE
pubsub-event-source   14h
</code></pre>
<p>But - I cannot find anything by asking for all objects:</p>
<pre><code>$ kubectl get all -n argo-events
No resources found in argo-events namespace.
</code></pre>
<p>So my question is. How can I generically list all lingering objects in argo-events?</p>
<p>I'm asking because otherwise I'd have to inspect the entire Object Browser Tree to maybe find more objects (as I cannot select the namespace anymore).</p>

Raffael
<p>By using command <code>$ kubectl get all</code> you will only print a few resources like:</p>
<ul>
<li>pod</li>
<li>service</li>
<li>daemonset</li>
<li>deployment</li>
<li>replicaset</li>
<li>statefulset</li>
<li>job</li>
<li>cronjobs</li>
</ul>
<p>It won't print all resources which can be found when you will use <code>$ kubectl api-resources</code>.</p>
<p><strong>Example</strong></p>
<p>When create <code>PV</code> from <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/#create-a-persistentvolume" rel="nofollow noreferrer">PersistentVolume</a> documentation it won't be listed in <code>$ kubectl get all</code> output, but it will be listed if you will specify this resource.</p>
<pre><code>$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/storage/pv-volume.yaml
persistentvolume/task-pv-volume created
$ kubectl get pv
NAME             CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM   STORAGECLASS   REASON   AGE
task-pv-volume   10Gi       RWO            Retain           Available           manual                  3m12s
$ kubectl get all
NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.3.240.1   &lt;none&gt;        443/TCP   86m
$ 
</code></pre>
<p>If you would like to list all resources from specific <code>namespace</code> you should use command below:</p>
<pre><code>kubectl -n argo-events api-resources --namespaced=true -o name | xargs --verbose -I {} kubectl -n argo-events get {} --show-kind --ignore-not-found
</code></pre>
<p>Above solution was presented in Github thread <a href="https://github.com/kubernetes/kubectl/issues/151" rel="nofollow noreferrer">kubectl get all does not list all resources in a namespace</a>. In this thread you might find some additional variations of above command.</p>
<p>In addition, you can also check <a href="https://www.studytonight.com/post/how-to-list-all-resources-in-a-kubernetes-namespace" rel="nofollow noreferrer">How to List all Resources in a Kubernetes Namespace</a> article. You can find there method to list resources using <code>function</code>.</p>
