List all resources in a namespace

List all resources in a namespace

A couple of times I needed to check what resources where still in a namespace, to understand why the namespace was still deleting after a while.

The kubectl get all -n namepace-name does not show all the resources so I found in internet this clever little command to show everything:

kubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get --ignore-not-found --show-kind -n namespace-name

It takes a bit, but it does the job!

Source: https://github.com/kubernetes/kubectl/issues/151#issuecomment-402003022