geekops
geekops

Reputation: 515

Automate GKE Node migration using terraform

I am using terraform to provision gke clusters. Currently if we have to modify the node pool properties we do it manually (create new nodepool, cordon old nodepool, drain nodes).

Is there a way i can automate it using terraform itself? currently if i change any properties it destroys and recreates the entire node.

Upvotes: 0

Views: 959

Answers (1)

Harsh Manvar
Harsh Manvar

Reputation: 30180

You can use the

lifecycle {
    create_before_destroy = true
  }

in terraform so it will create the Node pool first and then stop the old instance or node pool.

Read more about it : https://www.terraform.io/language/meta-arguments/lifecycle

Upvotes: 4

Related Questions