Search code examples
amazon-web-servicespacker

AWS, what is the best way to cycle nodes for AMI updates


This is how my workflow looks like:

  1. Bake new images with packer + chef on a weekly basis
  2. Deploy
  3. Cycle Nodes
  4. Test

I have a nice pipeline to bake and deploy images. #3 is still manual, I wrote a script to mark instances unhealthy that loops through every node.

What is a suggested approach to cycle nodes.


Solution

  • If you are using nodes in auto scaling groups, set termination policy to terminate old instance, then scale up to double the current node count and then scale down to current count. More details - https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html