Skip to content

Instantly share code, notes, and snippets.

@luigidifraia
Created May 11, 2021 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luigidifraia/2151a792721f1f5cc9f7b2b849905e6a to your computer and use it in GitHub Desktop.
Save luigidifraia/2151a792721f1f5cc9f7b2b849905e6a to your computer and use it in GitHub Desktop.
#!/bin/bash
# List all non-ephemeral containers used by pods in all namespaces of a k8s cluster
kubectl get pods --all-namespaces -o jsonpath="{.items[*].spec.containers[*].image}" | \
tr -s '[[:space:]]' '\n' | \
sort | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment