Skip to content

Instantly share code, notes, and snippets.

@mclarke47
Created June 27, 2017 13:49
Show Gist options
  • Save mclarke47/ec3b158b202c8ebc359b2a3e687b49de to your computer and use it in GitHub Desktop.
Save mclarke47/ec3b158b202c8ebc359b2a3e687b49de to your computer and use it in GitHub Desktop.
reboot kube-aws etcd nodes
#!/usr/bin/env bash
aws ec2 describe-instances --filter "Name=tag-key,Values=kube-aws:role" "Name=tag-value,Values=etcd" | jq -r '.Reservations[].Instances[].InstanceId' | while read object; do
echo "rebooting $object"
aws ec2 reboot-instances --instance-ids ${object}
sleep 300
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment