Skip to content

Commit c719dd4

Browse files
committed
feat: add cgroup & sysctls
1 parent fa5202b commit c719dd4

File tree

8 files changed

+70
-3
lines changed

8 files changed

+70
-3
lines changed

autogen/safer-cluster/main.tf.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ module "gke" {
9797
node_pools_taints = var.node_pools_taints
9898
node_pools_tags = var.node_pools_tags
9999

100-
node_pools_oauth_scopes = var.node_pools_oauth_scopes
100+
node_pools_oauth_scopes = var.node_pools_oauth_scopes
101+
node_pools_linux_node_configs_sysctls = var.node_pools_linux_node_configs_sysctls
102+
node_pools_cgroup_mode = var.node_pools_cgroup_mode
101103

102104
cluster_autoscaling = var.cluster_autoscaling
103105

autogen/safer-cluster/variables.tf.tmpl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,25 @@ variable "node_pools_oauth_scopes" {
224224
}
225225
}
226226

227+
variable "node_pools_linux_node_configs_sysctls" {
228+
type = map(map(string))
229+
description = "Map of maps containing linux node config sysctls by node-pool name"
230+
231+
default = {
232+
all = {}
233+
default-node-pool = {}
234+
}
235+
}
236+
variable "node_pools_cgroup_mode" {
237+
type = map(string)
238+
description = "Map of strings containing cgroup node config by node-pool name"
239+
240+
default = {
241+
all = ""
242+
default-node-pool = ""
243+
}
244+
}
245+
227246
variable "cluster_autoscaling" {
228247
type = object({
229248
enabled = bool

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ For simplicity, we suggest using `roles/container.admin` and
257257
| network | The VPC network to host the cluster in | `string` | n/a | yes |
258258
| network\_project\_id | The project ID of the shared VPC's host (for shared vpc support) | `string` | `""` | no |
259259
| node\_pools | List of maps containing node pools | `list(map(string))` | <pre>[<br> {<br> "name": "default-node-pool"<br> }<br>]</pre> | no |
260+
| 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 |
260261
| 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 |
262+
| 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 |
261263
| 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 |
262264
| 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 |
263265
| 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 |

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ module "gke" {
9393
node_pools_taints = var.node_pools_taints
9494
node_pools_tags = var.node_pools_tags
9595

96-
node_pools_oauth_scopes = var.node_pools_oauth_scopes
96+
node_pools_oauth_scopes = var.node_pools_oauth_scopes
97+
node_pools_linux_node_configs_sysctls = var.node_pools_linux_node_configs_sysctls
98+
node_pools_cgroup_mode = var.node_pools_cgroup_mode
9799

98100
cluster_autoscaling = var.cluster_autoscaling
99101

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,25 @@ variable "node_pools_oauth_scopes" {
224224
}
225225
}
226226

227+
variable "node_pools_linux_node_configs_sysctls" {
228+
type = map(map(string))
229+
description = "Map of maps containing linux node config sysctls by node-pool name"
230+
231+
default = {
232+
all = {}
233+
default-node-pool = {}
234+
}
235+
}
236+
variable "node_pools_cgroup_mode" {
237+
type = map(string)
238+
description = "Map of strings containing cgroup node config by node-pool name"
239+
240+
default = {
241+
all = ""
242+
default-node-pool = ""
243+
}
244+
}
245+
227246
variable "cluster_autoscaling" {
228247
type = object({
229248
enabled = bool

modules/safer-cluster/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ For simplicity, we suggest using `roles/container.admin` and
257257
| network | The VPC network to host the cluster in | `string` | n/a | yes |
258258
| network\_project\_id | The project ID of the shared VPC's host (for shared vpc support) | `string` | `""` | no |
259259
| node\_pools | List of maps containing node pools | `list(map(string))` | <pre>[<br> {<br> "name": "default-node-pool"<br> }<br>]</pre> | no |
260+
| 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 |
260261
| 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 |
262+
| 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 |
261263
| 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 |
262264
| 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 |
263265
| 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 |

modules/safer-cluster/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ module "gke" {
9393
node_pools_taints = var.node_pools_taints
9494
node_pools_tags = var.node_pools_tags
9595

96-
node_pools_oauth_scopes = var.node_pools_oauth_scopes
96+
node_pools_oauth_scopes = var.node_pools_oauth_scopes
97+
node_pools_linux_node_configs_sysctls = var.node_pools_linux_node_configs_sysctls
98+
node_pools_cgroup_mode = var.node_pools_cgroup_mode
9799

98100
cluster_autoscaling = var.cluster_autoscaling
99101

modules/safer-cluster/variables.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,25 @@ variable "node_pools_oauth_scopes" {
224224
}
225225
}
226226

227+
variable "node_pools_linux_node_configs_sysctls" {
228+
type = map(map(string))
229+
description = "Map of maps containing linux node config sysctls by node-pool name"
230+
231+
default = {
232+
all = {}
233+
default-node-pool = {}
234+
}
235+
}
236+
variable "node_pools_cgroup_mode" {
237+
type = map(string)
238+
description = "Map of strings containing cgroup node config by node-pool name"
239+
240+
default = {
241+
all = ""
242+
default-node-pool = ""
243+
}
244+
}
245+
227246
variable "cluster_autoscaling" {
228247
type = object({
229248
enabled = bool

0 commit comments

Comments
 (0)