Last active
August 15, 2019 14:36
-
-
Save tyrannasaurusbanks/163dc87310434a2ef99bb8f912e93d75 to your computer and use it in GitHub Desktop.
Shell onto nodes in cluster
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
# SSH onto node hosting last-created pod | |
kubectl get pods -n mantle -l=app=mantle-node-problem-detector -o jsonpath='{.items[0].status.hostIP}' --sort-by="metadata.creationTimestamp" | tail -n1 | xargs -0 bash -ic 'csshx -y 2 -x 2 -l core $@' -- | |
# SSH onto master | |
kubectl get nodes -l=kubernetes.io/role=master -o jsonpath='{.items[*].status.addresses[?(@.type=="InternalIP")].address}' | xargs -0 bash -ic 'csshx -y 2 -x 2 -l core $@' -- | |
# SSH onto every node | |
kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="InternalIP")].address}' | xargs -0 bash -ic 'csshx -y 2 -x 2 -l core $@' -- | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment