Skip to content

Instantly share code, notes, and snippets.

@chrislovecnm
Created September 14, 2017 00:26
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 chrislovecnm/134410c9c2b27c6723638953b6b03549 to your computer and use it in GitHub Desktop.
Save chrislovecnm/134410c9c2b27c6723638953b6b03549 to your computer and use it in GitHub Desktop.
zsh alias' for kops
getMasterIP()
CLUSTER=$1
AZ=$2
aws ec2 describe-instances --filter Name="tag-value",Values="master-${AZ}.masters.${CLUSTER}" --filter Name="instance-state-name",Values="running" | jq -r '.Reservations[0].Instances[0].PublicIpAddress'
}
tailMasterLog() {
IP=$(getMasterIP $1 $2)
ssh admin@$IP "tail -f /var/log/daemon.log"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment