Ignore controller user_data changes to allow plugin updates

* 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)
This commit is contained in:
Dalton Hubble 2018-10-28 15:11:47 -07:00
parent 8c4200d425
commit 0e71f7e565
10 changed files with 44 additions and 3 deletions

View File

@ -11,6 +11,8 @@ Notable changes between versions.
* Update Calico from v3.2.3 to [v3.3.0](https://docs.projectcalico.org/v3.3/releases/)
* Disable Kubelet read-only port ([#324](https://github.com/poseidon/typhoon/pull/324))
* Fix CoreDNS AntiAffinity spec to prefer spreading replicas
* Ignore controller node user-data changes ([#335](https://github.com/poseidon/typhoon/pull/335))
* Once all managed clusters use v1.12.2, it is possible to update `terraform-provider-ct`
#### AWS
@ -29,7 +31,7 @@ Notable changes between versions.
#### Google Cloud
* Add an IPv6 address and IPv6 forwarding rules for load balancing IPv6 Ingress
* Add an IPv6 address and IPv6 forwarding rules for load balancing IPv6 Ingress ([#334](https://github.com/poseidon/typhoon/pull/334))
* Add `ingress_static_ipv6` output variable for use in AAAA DNS records
* Allow serving IPv6 applications via Kubernetes Ingress

View File

@ -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",
]
}
}

View File

@ -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",
]
}
}

View File

@ -85,6 +85,7 @@ resource "azurerm_virtual_machine" "controllers" {
lifecycle {
ignore_changes = [
"storage_os_disk",
"os_profile",
]
}
}

View File

@ -50,6 +50,12 @@ resource "digitalocean_droplet" "controllers" {
tags = [
"${digitalocean_tag.controllers.id}",
]
lifecycle {
ignore_changes = [
"user_data",
]
}
}
# Tag to label controllers

View File

@ -43,6 +43,10 @@ resource "digitalocean_droplet" "workers" {
tags = [
"${digitalocean_tag.workers.id}",
]
lifecycle {
create_before_destroy = true
}
}
# Tag to label workers

View File

@ -50,6 +50,12 @@ resource "digitalocean_droplet" "controllers" {
tags = [
"${digitalocean_tag.controllers.id}",
]
lifecycle {
ignore_changes = [
"user_data",
]
}
}
# Tag to label controllers

View File

@ -43,6 +43,10 @@ resource "digitalocean_droplet" "workers" {
tags = [
"${digitalocean_tag.workers.id}",
]
lifecycle {
create_before_destroy = true
}
}
# Tag to label workers

View File

@ -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

View File

@ -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