Skip to content

Conversation

@bergemalm
Copy link
Contributor

This PR adds some missing variables in the safer-cluster modules.

  • node_pools_resource_manager_tags
  • node_pools_linux_node_configs_sysctls
  • node_pools_cgroup_mode
  • node_pools_hugepage_size_2m
  • node_pools_hugepage_size_1g
  • enable_secret_manager_addon

Closes #2369

@bergemalm bergemalm requested review from a team, apeabody and ericyz as code owners August 29, 2025 07:02
Copy link
Collaborator

@apeabody apeabody 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 contribution @bergemalm

Can you please build the templates and add to the commit: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/main/CONTRIBUTING.md#templating

@bergemalm bergemalm force-pushed the safer-clusters-missing-variables branch from 95b1031 to 49f136d Compare September 3, 2025 06:46
@bergemalm
Copy link
Contributor Author

Thanks for the contribution @bergemalm

Can you please build the templates and add to the commit: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/main/CONTRIBUTING.md#templating

Done. @apeabody

@apeabody
Copy link
Collaborator

apeabody commented Sep 3, 2025

/gcbrun

@bergemalm
Copy link
Contributor Author

bergemalm commented Oct 13, 2025

Checking in on this one. Any reason for not adding this one on last release? @apeabody

@apeabody
Copy link
Collaborator

/gemini review

Copy link
Contributor

@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 adds several new variables to the safer-cluster modules, exposing more configuration options for GKE node pools and enabling the Secret Manager addon. The changes are mostly boilerplate and have been applied across multiple generated files. I've identified a few minor issues related to formatting, ordering, and a description that could be improved for consistency and maintainability.

@apeabody
Copy link
Collaborator

/gcbrun

@bergemalm
Copy link
Contributor Author

Is there anything waiting on me to release this PR @apeabody ?

Copy link
Collaborator

@apeabody apeabody 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 contribution @bergemalm!

I've checked with the team, and to maintain the "safer-than-default configuration" of the safer-cluster, please drop sysctls and the 1g hugepage. Otherwise this looks, good. Thanks!

- node_pools_resource_manager_tags
- node_pools_cgroup_mode
- node_pools_hugepage_size_2m
- enable_secret_manager_addon
@bergemalm bergemalm force-pushed the safer-clusters-missing-variables branch from 490beed to a5ce97e Compare December 2, 2025 10:04
@bergemalm
Copy link
Contributor Author

bergemalm commented Dec 2, 2025

I removed node_pools_linux_node_configs_sysctls and node_pools_hugepage_size_1g and ran the make build - which then also added "display" yaml files (more than last run in August) where some still have the removed vars.
As mentioned I have to migrate away from this module so feel free to merge this or not.

@apeabody
Copy link
Collaborator

apeabody commented Dec 2, 2025

/gcbrun

@apeabody
Copy link
Collaborator

apeabody commented Dec 2, 2025

/gemini review

Copy link
Contributor

@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 adds several new variables to the safer-cluster modules. While the changes are mostly straightforward, there are a few areas that need attention. Some variables mentioned in the metadata files (node_pools_hugepage_size_1g, node_pools_linux_node_configs_sysctls) appear to be incompletely implemented as they are missing from the Terraform variable definitions and module calls. Additionally, there are some formatting inconsistencies, such as unaligned code in .tf files and unsorted lists in documentation and metadata, which should be addressed to improve maintainability. I've also noticed some misleading comments in variable definitions and an unrelated change for monitoring_auto_monitoring_config_scope that would be better in a separate PR. My detailed comments below provide specific suggestions for these points.

Comment on lines +214 to +228
node_pools_cgroup_mode:
name: node_pools_cgroup_mode
title: Node Pools Cgroup Mode
node_pools_hugepage_size_1g:
name: node_pools_hugepage_size_1g
title: Node Pools Hugepage Size 1G
node_pools_hugepage_size_2m:
name: node_pools_hugepage_size_2m
title: Node Pools Hugepage Size 2M
node_pools_labels:
name: node_pools_labels
title: Node Pools Labels
node_pools_linux_node_configs_sysctls:
name: node_pools_linux_node_configs_sysctls
title: Node Pools Linux Node Configs Sysctls
Copy link
Contributor

Choose a reason for hiding this comment

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

high

There are a couple of issues here:

  1. The variables node_pools_hugepage_size_1g and node_pools_linux_node_configs_sysctls are added to this metadata file, but they don't seem to be defined in variables.tf or used in main.tf. This looks like an incomplete implementation. Please either implement them fully or remove them for now.
  2. The variables in this section are not sorted alphabetically. Please sort them to improve readability and maintainability.

Comment on lines +214 to +228
node_pools_cgroup_mode:
name: node_pools_cgroup_mode
title: Node Pools Cgroup Mode
node_pools_hugepage_size_1g:
name: node_pools_hugepage_size_1g
title: Node Pools Hugepage Size 1G
node_pools_hugepage_size_2m:
name: node_pools_hugepage_size_2m
title: Node Pools Hugepage Size 2M
node_pools_labels:
name: node_pools_labels
title: Node Pools Labels
node_pools_linux_node_configs_sysctls:
name: node_pools_linux_node_configs_sysctls
title: Node Pools Linux Node Configs Sysctls
Copy link
Contributor

Choose a reason for hiding this comment

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

high

There are a couple of issues here:

  1. The variables node_pools_hugepage_size_1g and node_pools_linux_node_configs_sysctls are added to this metadata file, but they don't seem to be defined in variables.tf or used in main.tf. This looks like an incomplete implementation. Please either implement them fully or remove them for now.
  2. The variables in this section are not sorted alphabetically. Please sort them to improve readability and maintainability.

type = map(string)
description = "Map of strings containing cgroup node config by node-pool name"

# Default is being set in variables_defaults.tf
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This comment is misleading as the default value is defined in the block immediately below. Please remove this line to avoid confusion.

type = map(string)
description = "Map of strings containing hugepage size 2m node config by node-pool name"

# Default is being set in variables_defaults.tf
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This comment is misleading as the default value is defined in the block immediately below. Please remove this line to avoid confusion.

Comment on lines +288 to +290
monitoring_auto_monitoring_config_scope:
name: monitoring_auto_monitoring_config_scope
title: Monitoring Auto Monitoring Config Scope
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The addition of monitoring_auto_monitoring_config_scope seems unrelated to the other changes in this pull request. To keep PRs focused and easier to review, it's best to submit unrelated changes in a separate PR.

type = map(string)
description = "Map of strings containing cgroup node config by node-pool name"

# Default is being set in variables_defaults.tf
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This comment is misleading as the default value is defined in the block below. Please remove this line.

type = map(string)
description = "Map of strings containing hugepage size 2m node config by node-pool name"

# Default is being set in variables_defaults.tf
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This comment is misleading as the default value is defined in the block below. Please remove this line.

type = map(string)
description = "Map of strings containing cgroup node config by node-pool name"

# Default is being set in variables_defaults.tf
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This comment is misleading as the default value is defined in the block below. Please remove this line.

type = map(string)
description = "Map of strings containing hugepage size 2m node config by node-pool name"

# Default is being set in variables_defaults.tf
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This comment is misleading as the default value is defined in the block below. Please remove this line.

@apeabody
Copy link
Collaborator

apeabody commented Dec 2, 2025

I removed node_pools_linux_node_configs_sysctls and node_pools_hugepage_size_1g and ran the make build - which then also added "display" yaml files (more than last run in August) where some still have the removed vars. As mentioned I have to migrate away from this module so feel free to merge this or not.

Thanks @bergemalm - Yes, if you need sysctls then rather than safe-cluster I would recommend using the beta-private-cluster module.

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.

Add secrets manager config in safer-cluster

2 participants