Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubernetes - enable surge upgrades by default during cluster creation #584

Conversation

varshavaradarajan
Copy link
Contributor

Description: Now that surge upgrades is stable, enable surge upgrades by default as it is a better user experience during upgrades.

cc @adamwg

Copy link
Member

@andrewsomething andrewsomething left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, changing the default for a non-required attribute can be intrusive. Unless a user has explicitly set surge_upgrade in their configuration, they will be prompted to apply changes to existing clusters. E.g.

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # digitalocean_kubernetes_cluster.foo will be updated in-place
  ~ resource "digitalocean_kubernetes_cluster" "foo" {
        id             = "21ea2185-bc6d-4a64-8797-e7898bc57d2f"
        name           = "foo"
      ~ An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # digitalocean_kubernetes_cluster.foo will be updated in-place
  ~ resource "digitalocean_kubernetes_cluster" "foo" {
        id             = "21ea2185-bc6d-4a64-8797-e7898bc57d2f"
        name           = "foo"
      ~ surge_upgrade  = false -> true
        tags           = []
        # (12 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.-> true
        tags           = []
        # (12 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

The user can add surge_upgrade = false explicitly to prevent the diff.

I'm not necessarily opposed to the change if we think surge upgrades will provide a better user experience in the long run, but want to make the consequences of the change clear.

@@ -32,6 +32,7 @@ func dataSourceDigitalOceanKubernetesCluster() *schema.Resource {
"surge_upgrade": {
Type: schema.TypeBool,
Computed: true,
Default: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data sources just report the state returned by the API for existing resources. You probably want to change the resource:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrewsomething - I'm not sure if I should change the schema version if I just provide a default value. I have done so. But, let me know if that's necessary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally it's not needed unless you are doing a state migration, but there is no problem with bumping it.

https://www.terraform.io/docs/extend/resources/state-migration.html

@varshavaradarajan varshavaradarajan force-pushed the varsha/enable-surge-upgrades-by-default branch from dcb2595 to 764fe19 Compare February 17, 2021 04:05
@andrewsomething andrewsomething merged commit 2642296 into digitalocean:main Feb 19, 2021
andrewsomething added a commit that referenced this pull request Apr 26, 2021
…#584)

Co-authored-by: Andrew Starr-Bochicchio <andrewsomething@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants