Skip to content

Instantly share code, notes, and snippets.

@zed-eiq
Created September 29, 2024 07:52
Show Gist options
  • Select an option

  • Save zed-eiq/714233e8b92102d11d603c9449a57b37 to your computer and use it in GitHub Desktop.

Select an option

Save zed-eiq/714233e8b92102d11d603c9449a57b37 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
### Small script to get AWS EC2 instance ID from 'kubectl describe node'
alias k=kubectl
while getopts ":n:" opt; do
case ${opt} in
n) NODE=${OPTARG}
;;
esac
done
k describe no "${NODE}" | grep ProviderID | cut -d'/' -f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment