How to list all containers in Kubernetes?

This will get all container with the namespace in a pretty format:

kubectl get pods --all-namespaces -o=custom-columns=NameSpace:.metadata.namespace,NAME:.metadata.name,CONTAINERS:.spec.containers[*].name

When you don't use the namespace flag you are only looking in the default namespace. Try

kubectl get pod --all-namespaces

That will list all the pods in your cluster

You can filter via namespace like

kubectl get pod -n kube-system

To show all containers

kubectl get pods --all-namespaces -o jsonpath={.items[*].spec.containers[*].name}

kubectl get pods --all-namespaces

EDIT : damn, burned ! :)