Skip to content

Instantly share code, notes, and snippets.

@rdkls
Last active September 27, 2022 07:11
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 rdkls/346f681fed749c7f6ba832447ccdb3d7 to your computer and use it in GitHub Desktop.
Save rdkls/346f681fed749c7f6ba832447ccdb3d7 to your computer and use it in GitHub Desktop.
fish script to run a command on all pods
for pod in (kubectl get pods --field-selector=status.phase=Running --no-headers -o custom-columns=":metadata.name")
echo $pod
kubectl exec -ti $pod -- ping 1.1.1.1 -W1 -c1 -q >/dev/null
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment