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

Add upgrade_settings for NAP created node pools #1907

Closed
dhoeric opened this issue Mar 19, 2024 · 1 comment · Fixed by #1908
Closed

Add upgrade_settings for NAP created node pools #1907

dhoeric opened this issue Mar 19, 2024 · 1 comment · Fixed by #1908
Labels
enhancement New feature or request

Comments

@dhoeric
Copy link
Contributor

dhoeric commented Mar 19, 2024

TL;DR

The module is missing upgrade_settings on cluster_autoscaling > auto_provisioning_defaults under cluster configuration.

Adding upgrade_settings allow us to fine tune the upgrade behaviour of NAP created node pools.

Terraform Resources

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#upgrade_settings

Detailed design

Add followings on google_container_cluster resource

cluster_autoscaling {
  auto_provisioning_defaults {
    ...

    upgrade_settings {
      strategy        = lookup(var.cluster_autoscaling, "strategy", "SURGE")
      max_surge       = lookup(var.cluster_autoscaling, "strategy", "SURGE") == "SURGE" ? lookup(var.cluster_autoscaling, "max_surge", 0) : null
      max_unavailable = lookup(var.cluster_autoscaling, "strategy", "SURGE") == "SURGE" ? lookup(var.cluster_autoscaling, "max_unavailable", 0) : null

      dynamic "blue_green_settings" {
        for_each = lookup(var.cluster_autoscaling, "strategy", "SURGE") == "BLUE_GREEN" ? [1] : []
        content {
          node_pool_soak_duration = lookup(var.cluster_autoscaling, "node_pool_soak_duration", null)

          standard_rollout_policy {
            batch_soak_duration = lookup(var.cluster_autoscaling, "batch_soak_duration", null)
            batch_percentage    = lookup(var.cluster_autoscaling, "batch_percentage", null)
            batch_node_count    = lookup(var.cluster_autoscaling, "batch_node_count", null)
          }
        }
      }
    }
  }
}


### Additional information

_No response_
@amitblumshtien
Copy link

It would be also useful to attach service account from the code to each node pools created by nap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants