Skip to content

Commit

Permalink
Fix Fedora CoreOS on GCP proposing controller recreate
Browse files Browse the repository at this point in the history
* With Fedora CoreOS image stream support (#727), the latest
resolved image will change over the lifecycle of a cluster.
* Fix issue where an image diff proposed replacing a Fedora
CoreOS controller on GCP, introduced in #727 (unreleased)
* Also ignore image diffs to the GCP managed instance group
of workers. This aligns with worker AMI diffs being ignored
on AWS and similar on Azure, since workers update themselves.

Background:

* Controller nodes should strictly not be recreated by Terraform,
they are stateful (etcd) and should not be replaced
* Across cloud platforms, OS image diffs are ignored since both
Flatcar Linux and Fedora CoreOS nodes update themselves. For
workers, user-data or disk size diffs (where relevant) are allowed
to recreate workers templates/configs since these are considered
to be user-initiated declarations that a reprovision should be done
  • Loading branch information
dghubble committed May 20, 2020
1 parent 8d024d2 commit 09eb208
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion google-cloud/fedora-coreos/kubernetes/controllers.tf
Expand Up @@ -59,7 +59,10 @@ resource "google_compute_instance" "controllers" {
tags = ["${var.cluster_name}-controller"]

lifecycle {
ignore_changes = [metadata]
ignore_changes = [
metadata,
boot_disk[0].initialize_params
]
}
}

Expand Down
3 changes: 3 additions & 0 deletions google-cloud/fedora-coreos/kubernetes/workers/workers.tf
Expand Up @@ -64,6 +64,9 @@ resource "google_compute_instance_template" "worker" {
}

lifecycle {
ignore_changes = [
disk[0].source_image
]
# To update an Instance Template, Terraform should replace the existing resource
create_before_destroy = true
}
Expand Down

0 comments on commit 09eb208

Please sign in to comment.