Skip to content

Commit

Permalink
Ignore controller user_data changes to allow plugin updates
Browse files Browse the repository at this point in the history
* Updating the `terraform-provider-ct` plugin is known to produce
a `user_data` diff in all pre-existing clusters. Applying the
diff to pre-existing cluster destroys controller nodes
* Ignore changes to controller `user_data`. Once all managed
clusters use a release containing this change, it is possible
to update the `terraform-provider-ct` plugin (worker `user_data`
will still be modified)
* Changing the module `ref` for an existing cluster and
re-applying is still NOT supported (although this PR
would protect controllers from being destroyed)
  • Loading branch information
dghubble committed Oct 28, 2018
1 parent 8c4200d commit be42ffc
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 2 deletions.
5 changes: 4 additions & 1 deletion aws/container-linux/kubernetes/controllers.tf
Expand Up @@ -39,7 +39,10 @@ resource "aws_instance" "controllers" {
vpc_security_group_ids = ["${aws_security_group.controller.id}"]

lifecycle {
ignore_changes = ["ami"]
ignore_changes = [
"ami",
"user_data",
]
}
}

Expand Down
5 changes: 4 additions & 1 deletion aws/fedora-atomic/kubernetes/controllers.tf
Expand Up @@ -39,7 +39,10 @@ resource "aws_instance" "controllers" {
vpc_security_group_ids = ["${aws_security_group.controller.id}"]

lifecycle {
ignore_changes = ["ami"]
ignore_changes = [
"ami",
"user_data",
]
}
}

Expand Down
6 changes: 6 additions & 0 deletions digital-ocean/container-linux/kubernetes/controllers.tf
Expand Up @@ -50,6 +50,12 @@ resource "digitalocean_droplet" "controllers" {
tags = [
"${digitalocean_tag.controllers.id}",
]

lifecycle {
ignore_changes = [
"user_data",
]
}
}

# Tag to label controllers
Expand Down
4 changes: 4 additions & 0 deletions digital-ocean/container-linux/kubernetes/workers.tf
Expand Up @@ -43,6 +43,10 @@ resource "digitalocean_droplet" "workers" {
tags = [
"${digitalocean_tag.workers.id}",
]

lifecycle {
create_before_destroy = true
}
}

# Tag to label workers
Expand Down
6 changes: 6 additions & 0 deletions digital-ocean/fedora-atomic/kubernetes/controllers.tf
Expand Up @@ -50,6 +50,12 @@ resource "digitalocean_droplet" "controllers" {
tags = [
"${digitalocean_tag.controllers.id}",
]

lifecycle {
ignore_changes = [
"user_data",
]
}
}

# Tag to label controllers
Expand Down
4 changes: 4 additions & 0 deletions digital-ocean/fedora-atomic/kubernetes/workers.tf
Expand Up @@ -43,6 +43,10 @@ resource "digitalocean_droplet" "workers" {
tags = [
"${digitalocean_tag.workers.id}",
]

lifecycle {
create_before_destroy = true
}
}

# Tag to label workers
Expand Down
6 changes: 6 additions & 0 deletions google-cloud/container-linux/kubernetes/controllers.tf
Expand Up @@ -57,6 +57,12 @@ resource "google_compute_instance" "controllers" {

can_ip_forward = true
tags = ["${var.cluster_name}-controller"]

lifecycle {
ignore_changes = [
"metadata",
]
}
}

# Controller Ignition configs
Expand Down
6 changes: 6 additions & 0 deletions google-cloud/fedora-atomic/kubernetes/controllers.tf
Expand Up @@ -57,6 +57,12 @@ resource "google_compute_instance" "controllers" {

can_ip_forward = true
tags = ["${var.cluster_name}-controller"]

lifecycle {
ignore_changes = [
"metadata",
]
}
}

# Controller Cloud-Init
Expand Down

0 comments on commit be42ffc

Please sign in to comment.