3 ms·
I'm not too experienced with Terraform, can one use it to, for example, do a rolling deployment with something like haproxy as the load balancer?
by krmboya 6y ago
I'm not too experienced with Terraform, can one use it to, for example, do a rolling deployment with something like haproxy as the load balancer?
- tyree731 6y agoDefinitely not, you'd need to use something like Spinnaker to accomplish that.
- krmboya 6y agoBut one can do this with Ansible in a non-containerized environment
- escardin 6y agoConceptually this is exactly what Terraform is made for. It will deploy things with the parallelism rate you specify, and is designed to neatly scale your infra up and down. To do a rolling deployment though, it does become awkward, as you essentially have to model both the old version and the new version in your code, and then run the commands several times to scale up the new cluster and scale down the old one in stages. It's basically a modelling of a blue/green deploy.
- chousuke 6y agoI view Ansible and Terraform as complementary tools; I can imagine performing rolling upgrades by using Ansible to shoot down a node and then have Terraform rebuild it; and Terraform could use Ansible to configure the nodes, if you're not using images. For smaller systems one could use Ansible to create the infrastructure too, but I don't think it scales very well.