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

feat!: add service_externalips option, and add default for autoscaling location_policy #1440

Closed

Conversation

jpetrucciani
Copy link
Contributor

This PR adds the ability to set service_external_ips_config on the underlying cluster upon creation, which otherwise can (in my experience) take up to 20-30 minutes to enable independently after the cluster settles after initial creation. I've also added a default value for autoscaling location_policy for now, as this is something that appears to have a default on clusters created with 1.24+, but appears to be removed after a second plan+apply with this module.

I added the changes to the templates in ./autogen/ and ran make build in order to generate the changes across the repo

I've been testing cluster creation with these new settings already via my fork (and it appears to be working well! shaves a good amount of time off of our new cluster creation process), but would love to see it included in the official module if possible! Please let me know if there are any changes you'd like, or things I should take into account!

@google-cla
Copy link

google-cla bot commented Oct 26, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Member

@bharathkkb bharathkkb left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @jpetrucciani
Looks like this was added in 4.35 so we need to bump the minimum version in

https://github.com/hashicorp/terraform-provider-google/blob/main/CHANGELOG.md#4350-september-6-2022

@@ -202,6 +202,10 @@ resource "google_container_cluster" "primary" {
}
}

service_external_ips_config {
Copy link
Member

Choose a reason for hiding this comment

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

Can we make this a dynamic block if enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! let me include in the changes I'll make locally

@@ -96,6 +96,12 @@ variable "http_load_balancing" {
default = true
}

variable "service_externalips" {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
variable "service_externalips" {
variable "service_external_ips" {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, sounds good - I will make some changes locally and update!

max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = "BALANCED"
Copy link
Member

Choose a reason for hiding this comment

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

This seems like an unrelated change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unrelated to external ips yes, but this was something I've seen happen in clusters as of 1.24 - they get this default value from the provider, but this module will remove it on the next plan + apply. I can separate into second PR (and make it a var) if you'd like!

@bharathkkb bharathkkb changed the title feat: add service_externalips option, and add default for autoscaling location_policy feat!: add service_externalips option, and add default for autoscaling location_policy Oct 26, 2022
@jpetrucciani
Copy link
Contributor Author

made a new branch to represent just the main feature #1441

@comment-bot-dev
Copy link

@jpetrucciani
Thanks for the PR! 🚀
✅ Lint checks have passed.

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

Successfully merging this pull request may close these issues.

None yet

3 participants