Skip to content

Conversation

@ciroclover
Copy link

Fixes #2407

The diff shows a massive difference due to the "dynamic" block indentation.

The changes are:

  • Ensure that we define the initial_node_count when is not defined in the node-pool [ref].
  • Make the node-pool block dynamic. Add the conditional to ensure that the block is not generated when node_pools = [] [ref]
  • Fix the cluster_name variables in the main.tf. I honestly believe that we could just use cluster_name_computed = var.name, however, more tests should be needed. [ref]

@ciroclover ciroclover requested review from a team, apeabody and ericyz as code owners August 15, 2025 19:26
@google-cla
Copy link

google-cla bot commented Aug 15, 2025

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.

@m0ps
Copy link
Contributor

m0ps commented Aug 18, 2025

@ciroclover, I think, in such an arrangement, it would never be accepted. First of all, you have to use autogen to generate all submodules automatically. Also, don't forget to generate docs and perform proper linting... I would recommend you make yourself familiar with the contribution guide

@ciroclover ciroclover force-pushed the private-cluster-node-pool branch from 390dcc1 to d985e40 Compare August 20, 2025 13:46
@m0ps
Copy link
Contributor

m0ps commented Aug 22, 2025

@ciroclover

Note: The correct sequence to update the repo using autogen functionality is to run make build. This will create the various Terraform files, and then generate the Terraform documentation using terraform-docs.

ref: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/main/CONTRIBUTING.md#templating

@ciroclover ciroclover force-pushed the private-cluster-node-pool branch from cbab4aa to 3800ac7 Compare September 8, 2025 13:50
@ciroclover ciroclover closed this Sep 8, 2025
@ciroclover ciroclover force-pushed the private-cluster-node-pool branch from 3800ac7 to eeaf95d Compare September 8, 2025 13:55
@ciroclover ciroclover reopened this Sep 8, 2025
@ciroclover
Copy link
Author

Rebased with the main branch, fixed the template conflict, and ran make build. Any other dependencies before we get this one reviewed?

@apeabody
Copy link
Collaborator

apeabody commented Sep 8, 2025

/gcbrun

@mzglinski
Copy link

Hi, I would also benefit from this PR. Is there anything that is stopping it from further review?

@apeabody
Copy link
Collaborator

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for creating GKE clusters without a default node pool by making the node_pool block dynamic and adjusting related logic. The changes correctly handle the case where no node pools are defined. However, I've identified a critical pre-existing issue in how the inline default node pool is configured, which this PR touches. It incorrectly uses configuration from the first user-defined node pool (var.node_pools[0]), which can lead to misconfigurations. I've provided a detailed comment on this with recommendations for a safer approach. Additionally, I've suggested a simplification for computing the cluster name, which you also hinted at in your description.

@apeabody
Copy link
Collaborator

/gcbrun

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.

Support for GKE clusters with no default node pools

4 participants