Skip to content

Commit 49f136d

Browse files
committed
feat(safer-cluster): add some missing variables
- 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
1 parent 952223c commit 49f136d

File tree

12 files changed

+338
-21
lines changed

12 files changed

+338
-21
lines changed

autogen/safer-cluster/main.tf.tmpl

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,18 @@ module "gke" {
8989
// If removing the default node pool, initial_node_count should be at least 1.
9090
initial_node_count = (var.initial_node_count == 0) ? 1 : var.initial_node_count
9191

92-
node_pools = var.node_pools
93-
windows_node_pools = var.windows_node_pools
94-
node_pools_labels = var.node_pools_labels
95-
node_pools_resource_labels = var.node_pools_resource_labels
96-
node_pools_metadata = var.node_pools_metadata
97-
node_pools_taints = var.node_pools_taints
98-
node_pools_tags = var.node_pools_tags
92+
node_pools = var.node_pools
93+
windows_node_pools = var.windows_node_pools
94+
node_pools_labels = var.node_pools_labels
95+
node_pools_resource_labels = var.node_pools_resource_labels
96+
node_pools_resource_manager_tags = var.node_pools_resource_manager_tags
97+
node_pools_metadata = var.node_pools_metadata
98+
node_pools_linux_node_configs_sysctls = var.node_pools_linux_node_configs_sysctls
99+
node_pools_cgroup_mode = var.node_pools_cgroup_mode
100+
node_pools_hugepage_size_2m = var.node_pools_hugepage_size_2m
101+
node_pools_hugepage_size_1g = var.node_pools_hugepage_size_1g
102+
node_pools_taints = var.node_pools_taints
103+
node_pools_tags = var.node_pools_tags
99104

100105
node_pools_oauth_scopes = var.node_pools_oauth_scopes
101106

@@ -216,6 +221,8 @@ module "gke" {
216221

217222
enable_gcfs = var.enable_gcfs
218223

224+
enable_secret_manager_addon = var.enable_secret_manager_addon
225+
219226
// Enabling vulnerability and audit for workloads
220227
workload_vulnerability_mode = var.workload_vulnerability_mode
221228
workload_config_audit_mode = var.workload_config_audit_mode

autogen/safer-cluster/variables.tf.tmpl

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,16 @@ variable "node_pools_resource_labels" {
185185
}
186186
}
187187

188+
variable "node_pools_resource_manager_tags" {
189+
type = map(map(string))
190+
description = "Map of maps containing resource manager tags by node-pool name"
191+
192+
default = {
193+
all = {}
194+
default-node-pool = {}
195+
}
196+
}
197+
188198
variable "node_pools_metadata" {
189199
type = map(map(string))
190200
description = "Map of maps containing node metadata by node-pool name"
@@ -195,6 +205,50 @@ variable "node_pools_metadata" {
195205
}
196206
}
197207

208+
variable "node_pools_linux_node_configs_sysctls" {
209+
type = map(map(string))
210+
description = "Map of maps containing linux node config sysctls by node-pool name"
211+
212+
# Default is being set in variables_defaults.tf
213+
default = {
214+
all = {}
215+
default-node-pool = {}
216+
}
217+
}
218+
219+
variable "node_pools_cgroup_mode" {
220+
type = map(string)
221+
description = "Map of strings containing cgroup node config by node-pool name"
222+
223+
# Default is being set in variables_defaults.tf
224+
default = {
225+
all = ""
226+
default-node-pool = ""
227+
}
228+
}
229+
230+
variable "node_pools_hugepage_size_2m" {
231+
type = map(string)
232+
description = "Map of strings containing hugepage size 2m node config by node-pool name"
233+
234+
# Default is being set in variables_defaults.tf
235+
default = {
236+
all = ""
237+
default-node-pool = ""
238+
}
239+
}
240+
241+
variable "node_pools_hugepage_size_1g" {
242+
type = map(string)
243+
description = "Map of strings containing hugepage size 1g config by node-pool name"
244+
245+
# Default is being set in variables_defaults.tf
246+
default = {
247+
all = ""
248+
default-node-pool = ""
249+
}
250+
}
251+
198252
variable "node_pools_taints" {
199253
type = map(list(object({ key = string, value = string, effect = string })))
200254
description = "Map of lists containing node taints by node-pool name"
@@ -540,6 +594,12 @@ variable "enable_gcfs" {
540594
default = false
541595
}
542596

597+
variable "enable_secret_manager_addon" {
598+
description = "Enable the Secret Manager add-on for this cluster"
599+
type = bool
600+
default = false
601+
}
602+
543603
variable "enable_mesh_certificates" {
544604
type = bool
545605
default = false

modules/safer-cluster-update-variant/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ For simplicity, we suggest using `roles/container.admin` and
227227
| enable\_mesh\_certificates | Controls the issuance of workload mTLS certificates. When enabled the GKE Workload Identity Certificates controller and node agent will be deployed in the cluster. Requires Workload Identity. | `bool` | `false` | no |
228228
| enable\_pod\_security\_policy | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | `bool` | `false` | no |
229229
| enable\_private\_endpoint | When true, the cluster's private endpoint is used as the cluster endpoint and access through the public endpoint is disabled. When false, either endpoint can be used. This field only applies to private clusters, when enable\_private\_nodes is true | `bool` | `true` | no |
230+
| enable\_secret\_manager\_addon | Enable the Secret Manager add-on for this cluster | `bool` | `false` | no |
230231
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster. | `bool` | `true` | no |
231232
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
232233
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
@@ -261,10 +262,15 @@ For simplicity, we suggest using `roles/container.admin` and
261262
| network | The VPC network to host the cluster in | `string` | n/a | yes |
262263
| network\_project\_id | The project ID of the shared VPC's host (for shared vpc support) | `string` | `""` | no |
263264
| node\_pools | List of maps containing node pools | `list(map(string))` | <pre>[<br> {<br> "name": "default-node-pool"<br> }<br>]</pre> | no |
265+
| node\_pools\_cgroup\_mode | Map of strings containing cgroup node config by node-pool name | `map(string)` | <pre>{<br> "all": "",<br> "default-node-pool": ""<br>}</pre> | no |
266+
| node\_pools\_hugepage\_size\_1g | Map of strings containing hugepage size 1g config by node-pool name | `map(string)` | <pre>{<br> "all": "",<br> "default-node-pool": ""<br>}</pre> | no |
267+
| node\_pools\_hugepage\_size\_2m | Map of strings containing hugepage size 2m node config by node-pool name | `map(string)` | <pre>{<br> "all": "",<br> "default-node-pool": ""<br>}</pre> | no |
264268
| node\_pools\_labels | Map of maps containing node labels by node-pool name | `map(map(string))` | <pre>{<br> "all": {},<br> "default-node-pool": {}<br>}</pre> | no |
269+
| node\_pools\_linux\_node\_configs\_sysctls | Map of maps containing linux node config sysctls by node-pool name | `map(map(string))` | <pre>{<br> "all": {},<br> "default-node-pool": {}<br>}</pre> | no |
265270
| node\_pools\_metadata | Map of maps containing node metadata by node-pool name | `map(map(string))` | <pre>{<br> "all": {},<br> "default-node-pool": {}<br>}</pre> | no |
266271
| node\_pools\_oauth\_scopes | Map of lists containing node oauth scopes by node-pool name | `map(list(string))` | <pre>{<br> "all": [<br> "https://www.googleapis.com/auth/cloud-platform"<br> ],<br> "default-node-pool": []<br>}</pre> | no |
267272
| node\_pools\_resource\_labels | Map of maps containing resource labels by node-pool name | `map(map(string))` | <pre>{<br> "all": {},<br> "default-node-pool": {}<br>}</pre> | no |
273+
| node\_pools\_resource\_manager\_tags | Map of maps containing resource manager tags by node-pool name | `map(map(string))` | <pre>{<br> "all": {},<br> "default-node-pool": {}<br>}</pre> | no |
268274
| node\_pools\_tags | Map of lists containing node network tags by node-pool name | `map(list(string))` | <pre>{<br> "all": [],<br> "default-node-pool": []<br>}</pre> | no |
269275
| node\_pools\_taints | Map of lists containing node taints by node-pool name | `map(list(object({ key = string, value = string, effect = string })))` | <pre>{<br> "all": [],<br> "default-node-pool": []<br>}</pre> | no |
270276
| notification\_config\_topic | The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}. | `string` | `""` | no |

modules/safer-cluster-update-variant/main.tf

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,18 @@ module "gke" {
8585
// If removing the default node pool, initial_node_count should be at least 1.
8686
initial_node_count = (var.initial_node_count == 0) ? 1 : var.initial_node_count
8787

88-
node_pools = var.node_pools
89-
windows_node_pools = var.windows_node_pools
90-
node_pools_labels = var.node_pools_labels
91-
node_pools_resource_labels = var.node_pools_resource_labels
92-
node_pools_metadata = var.node_pools_metadata
93-
node_pools_taints = var.node_pools_taints
94-
node_pools_tags = var.node_pools_tags
88+
node_pools = var.node_pools
89+
windows_node_pools = var.windows_node_pools
90+
node_pools_labels = var.node_pools_labels
91+
node_pools_resource_labels = var.node_pools_resource_labels
92+
node_pools_resource_manager_tags = var.node_pools_resource_manager_tags
93+
node_pools_metadata = var.node_pools_metadata
94+
node_pools_linux_node_configs_sysctls = var.node_pools_linux_node_configs_sysctls
95+
node_pools_cgroup_mode = var.node_pools_cgroup_mode
96+
node_pools_hugepage_size_2m = var.node_pools_hugepage_size_2m
97+
node_pools_hugepage_size_1g = var.node_pools_hugepage_size_1g
98+
node_pools_taints = var.node_pools_taints
99+
node_pools_tags = var.node_pools_tags
95100

96101
node_pools_oauth_scopes = var.node_pools_oauth_scopes
97102

@@ -212,6 +217,8 @@ module "gke" {
212217

213218
enable_gcfs = var.enable_gcfs
214219

220+
enable_secret_manager_addon = var.enable_secret_manager_addon
221+
215222
// Enabling vulnerability and audit for workloads
216223
workload_vulnerability_mode = var.workload_vulnerability_mode
217224
workload_config_audit_mode = var.workload_config_audit_mode

modules/safer-cluster-update-variant/metadata.display.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ spec:
106106
enable_private_endpoint:
107107
name: enable_private_endpoint
108108
title: Enable Private Endpoint
109+
enable_secret_manager_addon:
110+
name: enable_secret_manager_addon
111+
title: Enable Secret Manager Addon
109112
enable_shielded_nodes:
110113
name: enable_shielded_nodes
111114
title: Enable Shielded Nodes
@@ -208,9 +211,21 @@ spec:
208211
node_pools:
209212
name: node_pools
210213
title: Node Pools
214+
node_pools_cgroup_mode:
215+
name: node_pools_cgroup_mode
216+
title: Node Pools Cgroup Mode
217+
node_pools_hugepage_size_1g:
218+
name: node_pools_hugepage_size_1g
219+
title: Node Pools Hugepage Size 1G
220+
node_pools_hugepage_size_2m:
221+
name: node_pools_hugepage_size_2m
222+
title: Node Pools Hugepage Size 2M
211223
node_pools_labels:
212224
name: node_pools_labels
213225
title: Node Pools Labels
226+
node_pools_linux_node_configs_sysctls:
227+
name: node_pools_linux_node_configs_sysctls
228+
title: Node Pools Linux Node Configs Sysctls
214229
node_pools_metadata:
215230
name: node_pools_metadata
216231
title: Node Pools Metadata
@@ -220,6 +235,9 @@ spec:
220235
node_pools_resource_labels:
221236
name: node_pools_resource_labels
222237
title: Node Pools Resource Labels
238+
node_pools_resource_manager_tags:
239+
name: node_pools_resource_manager_tags
240+
title: Node Pools Resource Manager Tags
223241
node_pools_tags:
224242
name: node_pools_tags
225243
title: Node Pools Tags

modules/safer-cluster-update-variant/metadata.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,42 @@ spec:
236236
defaultValue:
237237
all: {}
238238
default-node-pool: {}
239+
- name: node_pools_resource_manager_tags
240+
description: Map of maps containing resource manager tags by node-pool name
241+
varType: map(map(string))
242+
defaultValue:
243+
all: {}
244+
default-node-pool: {}
239245
- name: node_pools_metadata
240246
description: Map of maps containing node metadata by node-pool name
241247
varType: map(map(string))
242248
defaultValue:
243249
all: {}
244250
default-node-pool: {}
251+
- name: node_pools_linux_node_configs_sysctls
252+
description: Map of maps containing linux node config sysctls by node-pool name
253+
varType: map(map(string))
254+
defaultValue:
255+
all: {}
256+
default-node-pool: {}
257+
- name: node_pools_cgroup_mode
258+
description: Map of strings containing cgroup node config by node-pool name
259+
varType: map(string)
260+
defaultValue:
261+
all: ""
262+
default-node-pool: ""
263+
- name: node_pools_hugepage_size_2m
264+
description: Map of strings containing hugepage size 2m node config by node-pool name
265+
varType: map(string)
266+
defaultValue:
267+
all: ""
268+
default-node-pool: ""
269+
- name: node_pools_hugepage_size_1g
270+
description: Map of strings containing hugepage size 1g config by node-pool name
271+
varType: map(string)
272+
defaultValue:
273+
all: ""
274+
default-node-pool: ""
245275
- name: node_pools_taints
246276
description: Map of lists containing node taints by node-pool name
247277
varType: map(list(object({ key = string, value = string, effect = string })))
@@ -476,6 +506,10 @@ spec:
476506
description: Enable image streaming on cluster level.
477507
varType: bool
478508
defaultValue: false
509+
- name: enable_secret_manager_addon
510+
description: Enable the Secret Manager add-on for this cluster
511+
varType: bool
512+
defaultValue: false
479513
- name: enable_mesh_certificates
480514
description: Controls the issuance of workload mTLS certificates. When enabled the GKE Workload Identity Certificates controller and node agent will be deployed in the cluster. Requires Workload Identity.
481515
varType: bool

modules/safer-cluster-update-variant/variables.tf

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,16 @@ variable "node_pools_resource_labels" {
185185
}
186186
}
187187

188+
variable "node_pools_resource_manager_tags" {
189+
type = map(map(string))
190+
description = "Map of maps containing resource manager tags by node-pool name"
191+
192+
default = {
193+
all = {}
194+
default-node-pool = {}
195+
}
196+
}
197+
188198
variable "node_pools_metadata" {
189199
type = map(map(string))
190200
description = "Map of maps containing node metadata by node-pool name"
@@ -195,6 +205,50 @@ variable "node_pools_metadata" {
195205
}
196206
}
197207

208+
variable "node_pools_linux_node_configs_sysctls" {
209+
type = map(map(string))
210+
description = "Map of maps containing linux node config sysctls by node-pool name"
211+
212+
# Default is being set in variables_defaults.tf
213+
default = {
214+
all = {}
215+
default-node-pool = {}
216+
}
217+
}
218+
219+
variable "node_pools_cgroup_mode" {
220+
type = map(string)
221+
description = "Map of strings containing cgroup node config by node-pool name"
222+
223+
# Default is being set in variables_defaults.tf
224+
default = {
225+
all = ""
226+
default-node-pool = ""
227+
}
228+
}
229+
230+
variable "node_pools_hugepage_size_2m" {
231+
type = map(string)
232+
description = "Map of strings containing hugepage size 2m node config by node-pool name"
233+
234+
# Default is being set in variables_defaults.tf
235+
default = {
236+
all = ""
237+
default-node-pool = ""
238+
}
239+
}
240+
241+
variable "node_pools_hugepage_size_1g" {
242+
type = map(string)
243+
description = "Map of strings containing hugepage size 1g config by node-pool name"
244+
245+
# Default is being set in variables_defaults.tf
246+
default = {
247+
all = ""
248+
default-node-pool = ""
249+
}
250+
}
251+
198252
variable "node_pools_taints" {
199253
type = map(list(object({ key = string, value = string, effect = string })))
200254
description = "Map of lists containing node taints by node-pool name"
@@ -540,6 +594,12 @@ variable "enable_gcfs" {
540594
default = false
541595
}
542596

597+
variable "enable_secret_manager_addon" {
598+
description = "Enable the Secret Manager add-on for this cluster"
599+
type = bool
600+
default = false
601+
}
602+
543603
variable "enable_mesh_certificates" {
544604
type = bool
545605
default = false

modules/safer-cluster/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ For simplicity, we suggest using `roles/container.admin` and
227227
| enable\_mesh\_certificates | Controls the issuance of workload mTLS certificates. When enabled the GKE Workload Identity Certificates controller and node agent will be deployed in the cluster. Requires Workload Identity. | `bool` | `false` | no |
228228
| enable\_pod\_security\_policy | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | `bool` | `false` | no |
229229
| enable\_private\_endpoint | When true, the cluster's private endpoint is used as the cluster endpoint and access through the public endpoint is disabled. When false, either endpoint can be used. This field only applies to private clusters, when enable\_private\_nodes is true | `bool` | `true` | no |
230+
| enable\_secret\_manager\_addon | Enable the Secret Manager add-on for this cluster | `bool` | `false` | no |
230231
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster. | `bool` | `true` | no |
231232
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
232233
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
@@ -261,10 +262,15 @@ For simplicity, we suggest using `roles/container.admin` and
261262
| network | The VPC network to host the cluster in | `string` | n/a | yes |
262263
| network\_project\_id | The project ID of the shared VPC's host (for shared vpc support) | `string` | `""` | no |
263264
| node\_pools | List of maps containing node pools | `list(map(string))` | <pre>[<br> {<br> "name": "default-node-pool"<br> }<br>]</pre> | no |
265+
| node\_pools\_cgroup\_mode | Map of strings containing cgroup node config by node-pool name | `map(string)` | <pre>{<br> "all": "",<br> "default-node-pool": ""<br>}</pre> | no |
266+
| node\_pools\_hugepage\_size\_1g | Map of strings containing hugepage size 1g config by node-pool name | `map(string)` | <pre>{<br> "all": "",<br> "default-node-pool": ""<br>}</pre> | no |
267+
| node\_pools\_hugepage\_size\_2m | Map of strings containing hugepage size 2m node config by node-pool name | `map(string)` | <pre>{<br> "all": "",<br> "default-node-pool": ""<br>}</pre> | no |
264268
| node\_pools\_labels | Map of maps containing node labels by node-pool name | `map(map(string))` | <pre>{<br> "all": {},<br> "default-node-pool": {}<br>}</pre> | no |
269+
| node\_pools\_linux\_node\_configs\_sysctls | Map of maps containing linux node config sysctls by node-pool name | `map(map(string))` | <pre>{<br> "all": {},<br> "default-node-pool": {}<br>}</pre> | no |
265270
| node\_pools\_metadata | Map of maps containing node metadata by node-pool name | `map(map(string))` | <pre>{<br> "all": {},<br> "default-node-pool": {}<br>}</pre> | no |
266271
| node\_pools\_oauth\_scopes | Map of lists containing node oauth scopes by node-pool name | `map(list(string))` | <pre>{<br> "all": [<br> "https://www.googleapis.com/auth/cloud-platform"<br> ],<br> "default-node-pool": []<br>}</pre> | no |
267272
| node\_pools\_resource\_labels | Map of maps containing resource labels by node-pool name | `map(map(string))` | <pre>{<br> "all": {},<br> "default-node-pool": {}<br>}</pre> | no |
273+
| node\_pools\_resource\_manager\_tags | Map of maps containing resource manager tags by node-pool name | `map(map(string))` | <pre>{<br> "all": {},<br> "default-node-pool": {}<br>}</pre> | no |
268274
| node\_pools\_tags | Map of lists containing node network tags by node-pool name | `map(list(string))` | <pre>{<br> "all": [],<br> "default-node-pool": []<br>}</pre> | no |
269275
| node\_pools\_taints | Map of lists containing node taints by node-pool name | `map(list(object({ key = string, value = string, effect = string })))` | <pre>{<br> "all": [],<br> "default-node-pool": []<br>}</pre> | no |
270276
| notification\_config\_topic | The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}. | `string` | `""` | no |

0 commit comments

Comments
 (0)