问题原文
原帖链接 · czerny · CC BY-SA 3.0
How do i list all containers in Kubernetes cluster using kubectl?
Current documentation doesn't mention anything like 'container' resource.
kubectl get pod -o json
lists all pods which contains container descriptions. But is it possible to list containers as first class citizens?
已采纳解答
原帖链接 · Mike Barlow - BarDev · CC BY-SA 4.0
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
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
