Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shahabedinh/07b5a41728a8e3797e7c18816b7066a2 to your computer and use it in GitHub Desktop.
Save shahabedinh/07b5a41728a8e3797e7c18816b7066a2 to your computer and use it in GitHub Desktop.
To List All Containers in a Pod in Kubernetes Cluster
### To List All Containers in a Pod in Kubernetes Cluster
kubectl get pods <pod_name> -n <namespace> -o jsonpath={.spec.containers[*].name}
### Example
kubectl get pods ops-manager-0 -n test -o jsonpath={.spec.containers[*].name}
mongodb-ops-manager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment