siderolabs / terraform-provider-talos

Mozilla Public License 2.0
118 stars 15 forks source link

Zero downtime upgrade #59

Open alubbock opened 1 year ago

alubbock commented 1 year ago

Would it be possible to enact Talos upgrades just by specifying a new image ID? By default, it seems that all VMs would be destroyed and recreated, which would probably break the cluster.

Terraform gives an example of zero downtime upgrades that utilises create_before_destroy = true combined with a local-exec to run a healthcheck before the original is destroyed:

resource "digitalocean_droplet" "web" {
  count  = 2
  image  = "${var.image}"
#...
  lifecycle {
    create_before_destroy = true
  }

  provisioner "local-exec" {
    command = "./check_health.sh ${self.ipv4_address}"
  }

Would it be possible to use local-exec to execute talosctl health? It would probably fail during initial cluster bootstrapping, so it'd need to workaround that to only run on upgrades.

smira commented 6 months ago

This provider doesn't support talosctl upgrade at the moment, and VM being re-created on image change is not related to this provider.