-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 remove_default_node_pool #55
Conversation
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.
Thanks for looking into this. I believe there are some complexities with the 0-node default pool we currently create for clusters with node_pools configured - could you take a look at that?
The other thing to test/confirm is compatibility with Shared VPC clusters.
cluster_zonal.tf
Outdated
@@ -26,8 +26,8 @@ resource "google_container_cluster" "zonal_primary" { | |||
zone = "${var.zones[0]}" | |||
additional_zones = ["${slice(var.zones,1,length(var.zones))}"] | |||
|
|||
network = "${data.google_compute_network.gke_network.self_link}" | |||
subnetwork = "${data.google_compute_subnetwork.gke_subnetwork.self_link}" | |||
network = "projects/${var.project_id}/global/networks/${data.google_compute_network.gke_network.name}" |
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.
Isn't that equivalent to the self_link?
The issue with formatting it like this is if the cluster is being launched on a shared VPC, in which case the network is in a different project.
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.
self_link adds https://www.googleapis.com/compute/v1
before the projects/[..]
, hence the permadiff since terraform sees the current path as the one starting from projects/[..]
and tries to update it.
I'll take a look at the shared VPC case and will come with a solution/an idea hopefully. :-)
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.
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.
One alternative idea: what if we used the self_link but used replace
to strip the URL prefix? https://www.terraform.io/docs/configuration/interpolation.html#replace-string-search-replace-
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.
Sounds good.
As simple as network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"
?
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.
Added in e997e66. :-)
Yes I think that should work.
…On Fri, Jan 4, 2019 at 10:18 Mateusz Kubaczyk ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In cluster_zonal.tf
<#55 (comment)>
:
> @@ -26,8 +26,8 @@ resource "google_container_cluster" "zonal_primary" {
zone = "${var.zones[0]}"
additional_zones = ["${slice(var.zones,1,length(var.zones))}"]
- network = "${data.google_compute_network.gke_network.self_link}"
- subnetwork = "${data.google_compute_subnetwork.gke_subnetwork.self_link}"
+ network = "projects/${var.project_id}/global/networks/${data.google_compute_network.gke_network.name}"
Sounds good.
As simple as network =
"${replace(data.google_compute_network.gke_network.self_link, "
https://www.googleapis.com/compute/v1/", "")}" ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#55 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABjWmftRAA4mwVbh92E__hOg1gpzVR8vks5u_3CsgaJpZM4Zo1Fv>
.
|
…ove_default_node_pool
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! Thanks for the contribution.
Add remove_default_node_pool
In the #15 issue there was a request for remove_default_node_pool. I'm interested in introducing this to the module. There's no point in keeping the default node pool the
google_container_cluster
forces us to have on the beginning. Usually, the one wants to manage the pools explicitly, and so do I, hence this PR.Adding the
remove_default_node_pool
was not enough to make it work perfectly. A change in the manner of providing thegoogle_container_cluster
with the network and subnetwork parameters had to be changed as well. Without it, terraform produced permadiff with everyplan
andapply
. That's the issue with google provider, more on that is described in this google provider issue.The approach I propose is a workaround which won't cause any backward incompatibilities. The issue I faced might be the problem described from the #15.
If anyone is having the better solution, feel free to propose it!