Last active
October 3, 2024 02:29
-
-
Save zulhfreelancer/5446c3cc4fae527ed5f4af4f044e7557 to your computer and use it in GitHub Desktop.
Revisions
-
zulhfreelancer revised this gist
Oct 3, 2024 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -10,4 +10,12 @@ kubectl get pods -A -o json | jq -r '.items[] | select(.metadata.uid == "<UID>") ``` kubectl get pods -A -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name,UID:.metadata.uid | grep <UID> ``` ### Option #3 > If you're using Docker, run this on _each_ node ``` docker ps -a --format '{{.Names}}' | grep <UID> ``` -
zulhfreelancer created this gist
Oct 3, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ ## How to find a pod by UID? ### Option #1 ``` kubectl get pods -A -o json | jq -r '.items[] | select(.metadata.uid == "<UID>") | .metadata.name, .metadata.namespace' ``` ### Option #2 ``` kubectl get pods -A -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name,UID:.metadata.uid | grep <UID> ```