This file contains 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
#### WAY with crictl | |
#### TODO validate crictl with docker runtime !! | |
# Get all pods of a specific node | |
#kubectl get po --field-selector=spec.nodeName="fluffy-master" --all-namespaces | |
kubectl get --all-namespaces po --field-selector=spec.nodeName=="$(hostname)" -o json | jq -r '.items[] | select(.status.hostIP!=.status.podIP) | "\(.metadata.name) \(.metadata.namespace)"' | |
# Get the Pod ID of the Pod with crictl | |
POD_ID=$(sudo crictl pods --name=nginx-6f858d4d45-vnszm --namespace=default -q --no-trunc) |