Managed Kubernetes
Latest
Frequently Asked Questions
Solutions
How Tos
Internal Only
Templates
Powered By

Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
How to List all Containers Running in a Cluster
Copy Markdown
Open in ChatGPT
Open in Claude
Problem
View all the containers runnings inside a cluster.
Environment
- Platform9 Managed Kubernetes - All Versions
- kubectl
Procedure
- Download the kubeconfig for the cluster you want the information for.
- Save the kubeconfig at the following path ~/.kube/config or run the kubectl command with the --kubeconfig= command
- Run the following command to get a list and number of running containers of each type.
Bash
xxxxxxxxxxkubectl get pods --all-namespaces -o jsonpath="{.items[*].spec.containers[*].name}" | tr -s ' ' '\n' |sort |uniq -cAdditional Information
You can obtain other information about the containers by changing the spec. value. For example you can get a list and number of all images running in a cluster by running the above command with spec.containers[*].image.
VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches
Last updated on
Was this page helpful?
Discard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message