-
Notifications
You must be signed in to change notification settings - Fork 266
Ignore AMI updates on etcd/master nodes to prevent destroying nodes accidently #367
Conversation
a40b4b4
to
5533bef
Compare
I was going to make changes to parameterize the It seems there's no way to easily prevent destruction of a resource during apply, but allow for it during |
5533bef
to
62e0b33
Compare
Currently if a new version of CoreOS comes out on a user's configured channel after they've already deployed, and they re-run terraform apply, Terraform will detect the new AMI, and when reconciling desired state, it will attempt to destroy existing nodes to update the AMI. In order to avoid this, I added a ignore_changes to both the etcd node resource, and the master launch configuration resource, to avoid updating masters/etcd nodes if the AMI changes. Longer term, I would expect the Container Linux Update Operator, or a terraform operator could resolve this, but this seems like a reasonable change to prevent accidental destruction of a cluster. Previously this change also set prevent_destroy, but that cannot be parameterized with vars, so it was removed.
62e0b33
to
abb1aef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, good catch, but I would like to have @alexsomesan have another look.
I agree with @s-urbaniak. It's a good fix. LGTM. |
Why not add to workers as well? |
I figured I'd keep the scope small since it's a no brainer for etcd and masters, but wasn't sure about workers. I'd be glad to make another PR with the same change. |
Prevents terraform from recreating the resource when a new CoreOS release comes out. This an extension of the same changes done to etcd and masters in coreos#367
Prevents terraform from recreating the resource when a new CoreOS release comes out. This an extension of the same changes done to etcd and masters in coreos#367
Prevents terraform from recreating the resource when a new CoreOS release comes out. This an extension of the same changes done to etcd and masters in coreos#367
Currently if a new version of CoreOS comes out on a user's configured
channel after they've already deployed, and they re-run terraform apply,
Terraform will detect the new AMI, and when reconciling desired state,
it will attempt to destroy existing nodes to update the AMI.
In order to avoid this, I added a ignore_changes to both the etcd node
resource, and the master launch configuration resource, to avoid
updating masters/etcd nodes if the AMI changes.
Longer term, I would expect the Container Linux Update Operator, or a
terraform operator could resolve this, but this seems like a reasonable
change to prevent accidental destruction of a cluster.
Previously this change also set prevent_destroy, but that cannot be
parameterized with vars, so it was removed.