Created
September 10, 2024 12:59
-
-
Save alces/7f06eea273d63d4fd874b1e2d77d6fa4 to your computer and use it in GitHub Desktop.
Find all k8s pods running an image with a given imageID
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# Find all the pods using a given imageID | |
kubectl get pods --all-namespaces \ | |
-o 'custom-columns=NS:.metadata.namespace,NAME:.metadata.name,IMAGE:.status.containerStatuses[*].imageID' | | |
awk '{if ($3 ~ "bitnami/external-dns@sha256:b615d1c97d93e5a4d83da00de8d1854f0274814b4ef57708d0ed9341205753e9") {print $1 "/" $2}}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment