Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 471 Bytes

README.md

File metadata and controls

22 lines (18 loc) · 471 Bytes

Kubernetes

List all containers

kubectl get pods --all-namespaces \
    -o jsonpath="{.items[*].spec['initContainers', 'containers', 'ephemeralContainers'][*].image}" |\
  tr -s '[[:space:]]' '\n' | \
  sort | \
  uniq

Sort by usage

kubectl get pods --all-namespaces \
    -o jsonpath="{.items[*].spec['initContainers', 'containers', 'ephemeralContainers'][*].image}" |\
  tr -s '[[:space:]]' '\n' | \
  sort | \
  uniq -c | \
  sort -ndr