Skip to content

Commit ee3e75c

Browse files
authored
Merge branch 'main' into huge_pages
2 parents 9a4a35f + 22712d4 commit ee3e75c

File tree

27 files changed

+266
-45
lines changed

27 files changed

+266
-45
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,13 @@ The node_pools variable takes the following parameters:
323323
| cpu_cfs_quota | Enforces the Pod's CPU limit. Setting this value to false means that the CPU limits for Pods are ignored | null | Optional |
324324
| cpu_cfs_quota_period | The CPU CFS quota period value, which specifies the period of how often a cgroup's access to CPU resources should be reallocated | null | Optional |
325325
| pod_pids_limit | Controls the maximum number of processes allowed to run in a pod. The value must be greater than or equal to 1024 and less than 4194304. | null | Optional |
326+
| container_log_max_size | Defines the maximum size of the container log file before it is rotated. | null | Optional |
327+
| container_log_max_files | Defines the maximum number of container log files that can be present for a container. | null | Optional |
328+
| image_gc_low_threshold_percent | Defines the percent of disk usage before which image garbage collection is never run. Lowest disk usage to garbage collect to. | null | Optional |
329+
| image_gc_high_threshold_percent | Defines the percent of disk usage after which image garbage collection is always run. | null | Optional |
330+
| image_minimum_gc_age | Defines the minimum age for an unused image before it is garbage collected. | null | Optional |
331+
| image_maximum_gc_age | Defines the maximum age an image can be unused before it is garbage collected. | null | Optional |
332+
| allowed_unsafe_sysctls | Defines a comma-separated allowlist of unsafe sysctls or sysctl patterns which can be set on the Pods. This should be passed as comma separated string. | null | Optional |
326333
| enable_confidential_nodes | An optional flag to enable confidential node config. | false | Optional |
327334
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
328335
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |

autogen/main/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,13 @@ The node_pools variable takes the following parameters:
203203
| cpu_cfs_quota | Enforces the Pod's CPU limit. Setting this value to false means that the CPU limits for Pods are ignored | null | Optional |
204204
| cpu_cfs_quota_period | The CPU CFS quota period value, which specifies the period of how often a cgroup's access to CPU resources should be reallocated | null | Optional |
205205
| pod_pids_limit | Controls the maximum number of processes allowed to run in a pod. The value must be greater than or equal to 1024 and less than 4194304. | null | Optional |
206+
| container_log_max_size | Defines the maximum size of the container log file before it is rotated. | null | Optional |
207+
| container_log_max_files | Defines the maximum number of container log files that can be present for a container. | null | Optional |
208+
| image_gc_low_threshold_percent | Defines the percent of disk usage before which image garbage collection is never run. Lowest disk usage to garbage collect to. | null | Optional |
209+
| image_gc_high_threshold_percent | Defines the percent of disk usage after which image garbage collection is always run. | null | Optional |
210+
| image_minimum_gc_age | Defines the minimum age for an unused image before it is garbage collected. | null | Optional |
211+
| image_maximum_gc_age | Defines the maximum age an image can be unused before it is garbage collected. | null | Optional |
212+
| allowed_unsafe_sysctls | Defines a comma-separated allowlist of unsafe sysctls or sysctl patterns which can be set on the Pods. This should be passed as comma separated string. | null | Optional |
206213
| enable_confidential_nodes | An optional flag to enable confidential node config. | false | Optional |
207214
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
208215
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |

autogen/main/cluster.tf.tmpl

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ resource "google_container_cluster" "primary" {
589589
dynamic "kubelet_config" {
590590
for_each = length(setintersection(
591591
keys(var.node_pools[0]),
592-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "insecure_kubelet_readonly_port_enabled", "pod_pids_limit"]
592+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "insecure_kubelet_readonly_port_enabled", "pod_pids_limit", "container_log_max_size", "container_log_max_files", "image_gc_low_threshold_percent", "image_gc_high_threshold_percent", "image_minimum_gc_age", "image_maximum_gc_age", "allowed_unsafe_sysctls"]
593593
)) != 0 || var.insecure_kubelet_readonly_port_enabled != null ? [1] : []
594594

595595
content {
@@ -598,6 +598,13 @@ resource "google_container_cluster" "primary" {
598598
cpu_cfs_quota_period = lookup(var.node_pools[0], "cpu_cfs_quota_period", null)
599599
insecure_kubelet_readonly_port_enabled = lookup(var.node_pools[0], "insecure_kubelet_readonly_port_enabled", var.insecure_kubelet_readonly_port_enabled) != null ? upper(tostring(lookup(var.node_pools[0], "insecure_kubelet_readonly_port_enabled", var.insecure_kubelet_readonly_port_enabled))) : null
600600
pod_pids_limit = lookup(var.node_pools[0], "pod_pids_limit", null)
601+
container_log_max_size = lookup(var.node_pools[0], "container_log_max_size", null)
602+
container_log_max_files = lookup(var.node_pools[0], "container_log_max_files", null)
603+
image_gc_low_threshold_percent = lookup(var.node_pools[0], "image_gc_low_threshold_percent", null)
604+
image_gc_high_threshold_percent = lookup(var.node_pools[0], "image_gc_high_threshold_percent", null)
605+
image_minimum_gc_age = lookup(var.node_pools[0], "image_minimum_gc_age", null)
606+
image_maximum_gc_age = lookup(var.node_pools[0], "image_maximum_gc_age", null)
607+
allowed_unsafe_sysctls = lookup(var.node_pools[0], "allowed_unsafe_sysctls", null) == null ? null : [for s in split(",", lookup(var.node_pools[0], "allowed_unsafe_sysctls", null)) : trimspace(s)]
601608
}
602609
}
603610

@@ -1144,7 +1151,7 @@ resource "google_container_node_pool" "windows_pools" {
11441151
dynamic "kubelet_config" {
11451152
for_each = length(setintersection(
11461153
keys(each.value),
1147-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "insecure_kubelet_readonly_port_enabled", "pod_pids_limit"]
1154+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "insecure_kubelet_readonly_port_enabled", "pod_pids_limit", "container_log_max_size", "container_log_max_files", "image_gc_low_threshold_percent", "image_gc_high_threshold_percent", "image_minimum_gc_age", "image_maximum_gc_age", "allowed_unsafe_sysctls"]
11481155
)) != 0 ? [1] : []
11491156

11501157
content {
@@ -1153,6 +1160,13 @@ resource "google_container_node_pool" "windows_pools" {
11531160
cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null)
11541161
insecure_kubelet_readonly_port_enabled = lookup(each.value, "insecure_kubelet_readonly_port_enabled", null) != null ? upper(tostring(each.value.insecure_kubelet_readonly_port_enabled)) : null
11551162
pod_pids_limit = lookup(each.value, "pod_pids_limit", null)
1163+
container_log_max_size = lookup(each.value, "container_log_max_size", null)
1164+
container_log_max_files = lookup(each.value, "container_log_max_files", null)
1165+
image_gc_low_threshold_percent = lookup(each.value, "image_gc_low_threshold_percent", null)
1166+
image_gc_high_threshold_percent = lookup(each.value, "image_gc_high_threshold_percent", null)
1167+
image_minimum_gc_age = lookup(each.value, "image_minimum_gc_age", null)
1168+
image_maximum_gc_age = lookup(each.value, "image_maximum_gc_age", null)
1169+
allowed_unsafe_sysctls = lookup(each.value, "allowed_unsafe_sysctls", null) == null ? null : [for s in split(",", lookup(each.value, "allowed_unsafe_sysctls", null)) : trimspace(s)]
11561170
}
11571171
}
11581172

cluster.tf

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ resource "google_container_cluster" "primary" {
446446
dynamic "kubelet_config" {
447447
for_each = length(setintersection(
448448
keys(var.node_pools[0]),
449-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "insecure_kubelet_readonly_port_enabled", "pod_pids_limit"]
449+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "insecure_kubelet_readonly_port_enabled", "pod_pids_limit", "container_log_max_size", "container_log_max_files", "image_gc_low_threshold_percent", "image_gc_high_threshold_percent", "image_minimum_gc_age", "image_maximum_gc_age", "allowed_unsafe_sysctls"]
450450
)) != 0 || var.insecure_kubelet_readonly_port_enabled != null ? [1] : []
451451

452452
content {
@@ -455,6 +455,13 @@ resource "google_container_cluster" "primary" {
455455
cpu_cfs_quota_period = lookup(var.node_pools[0], "cpu_cfs_quota_period", null)
456456
insecure_kubelet_readonly_port_enabled = lookup(var.node_pools[0], "insecure_kubelet_readonly_port_enabled", var.insecure_kubelet_readonly_port_enabled) != null ? upper(tostring(lookup(var.node_pools[0], "insecure_kubelet_readonly_port_enabled", var.insecure_kubelet_readonly_port_enabled))) : null
457457
pod_pids_limit = lookup(var.node_pools[0], "pod_pids_limit", null)
458+
container_log_max_size = lookup(var.node_pools[0], "container_log_max_size", null)
459+
container_log_max_files = lookup(var.node_pools[0], "container_log_max_files", null)
460+
image_gc_low_threshold_percent = lookup(var.node_pools[0], "image_gc_low_threshold_percent", null)
461+
image_gc_high_threshold_percent = lookup(var.node_pools[0], "image_gc_high_threshold_percent", null)
462+
image_minimum_gc_age = lookup(var.node_pools[0], "image_minimum_gc_age", null)
463+
image_maximum_gc_age = lookup(var.node_pools[0], "image_maximum_gc_age", null)
464+
allowed_unsafe_sysctls = lookup(var.node_pools[0], "allowed_unsafe_sysctls", null) == null ? null : [for s in split(",", lookup(var.node_pools[0], "allowed_unsafe_sysctls", null)) : trimspace(s)]
458465
}
459466
}
460467

@@ -839,7 +846,7 @@ resource "google_container_node_pool" "pools" {
839846
dynamic "kubelet_config" {
840847
for_each = length(setintersection(
841848
keys(each.value),
842-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "insecure_kubelet_readonly_port_enabled", "pod_pids_limit"]
849+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "insecure_kubelet_readonly_port_enabled", "pod_pids_limit", "container_log_max_size", "container_log_max_files", "image_gc_low_threshold_percent", "image_gc_high_threshold_percent", "image_minimum_gc_age", "image_maximum_gc_age", "allowed_unsafe_sysctls"]
843850
)) != 0 ? [1] : []
844851

845852
content {
@@ -848,6 +855,13 @@ resource "google_container_node_pool" "pools" {
848855
cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null)
849856
insecure_kubelet_readonly_port_enabled = lookup(each.value, "insecure_kubelet_readonly_port_enabled", null) != null ? upper(tostring(each.value.insecure_kubelet_readonly_port_enabled)) : null
850857
pod_pids_limit = lookup(each.value, "pod_pids_limit", null)
858+
container_log_max_size = lookup(each.value, "container_log_max_size", null)
859+
container_log_max_files = lookup(each.value, "container_log_max_files", null)
860+
image_gc_low_threshold_percent = lookup(each.value, "image_gc_low_threshold_percent", null)
861+
image_gc_high_threshold_percent = lookup(each.value, "image_gc_high_threshold_percent", null)
862+
image_minimum_gc_age = lookup(each.value, "image_minimum_gc_age", null)
863+
image_maximum_gc_age = lookup(each.value, "image_maximum_gc_age", null)
864+
allowed_unsafe_sysctls = lookup(each.value, "allowed_unsafe_sysctls", null) == null ? null : [for s in split(",", lookup(each.value, "allowed_unsafe_sysctls", null)) : trimspace(s)]
851865
}
852866
}
853867

@@ -1180,7 +1194,7 @@ resource "google_container_node_pool" "windows_pools" {
11801194
dynamic "kubelet_config" {
11811195
for_each = length(setintersection(
11821196
keys(each.value),
1183-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "insecure_kubelet_readonly_port_enabled", "pod_pids_limit"]
1197+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "insecure_kubelet_readonly_port_enabled", "pod_pids_limit", "container_log_max_size", "container_log_max_files", "image_gc_low_threshold_percent", "image_gc_high_threshold_percent", "image_minimum_gc_age", "image_maximum_gc_age", "allowed_unsafe_sysctls"]
11841198
)) != 0 ? [1] : []
11851199

11861200
content {
@@ -1189,6 +1203,13 @@ resource "google_container_node_pool" "windows_pools" {
11891203
cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null)
11901204
insecure_kubelet_readonly_port_enabled = lookup(each.value, "insecure_kubelet_readonly_port_enabled", null) != null ? upper(tostring(each.value.insecure_kubelet_readonly_port_enabled)) : null
11911205
pod_pids_limit = lookup(each.value, "pod_pids_limit", null)
1206+
container_log_max_size = lookup(each.value, "container_log_max_size", null)
1207+
container_log_max_files = lookup(each.value, "container_log_max_files", null)
1208+
image_gc_low_threshold_percent = lookup(each.value, "image_gc_low_threshold_percent", null)
1209+
image_gc_high_threshold_percent = lookup(each.value, "image_gc_high_threshold_percent", null)
1210+
image_minimum_gc_age = lookup(each.value, "image_minimum_gc_age", null)
1211+
image_maximum_gc_age = lookup(each.value, "image_maximum_gc_age", null)
1212+
allowed_unsafe_sysctls = lookup(each.value, "allowed_unsafe_sysctls", null) == null ? null : [for s in split(",", lookup(each.value, "allowed_unsafe_sysctls", null)) : trimspace(s)]
11921213
}
11931214
}
11941215

examples/confidential_safer_cluster/network.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
module "gcp-network" {
1818
source = "terraform-google-modules/network/google"
19-
version = "~> 10.0"
19+
version = "~> 11.0"
2020

2121
project_id = var.project_id
2222
network_name = local.network_name

examples/deploy_service/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ resource "kubernetes_pod" "nginx-example" {
5555

5656
spec {
5757
container {
58-
image = "nginx:1.27.5"
58+
image = "nginx:1.28.0"
5959
name = "nginx-example"
6060
}
6161
}

examples/island_cluster_anywhere_in_gcp_design/network.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
module "net" {
1616
source = "terraform-google-modules/network/google"
17-
version = "~> 10.0"
17+
version = "~> 11.0"
1818

1919
for_each = { for k, v in var.gke_spokes : k => v }
2020

@@ -163,7 +163,7 @@ resource "google_compute_network_attachment" "router_net_attachment" {
163163

164164
module "cloud_router" {
165165
source = "terraform-google-modules/cloud-router/google"
166-
version = "~> 6.0"
166+
version = "~> 7.0"
167167
for_each = { for k, v in var.gke_spokes : k => v }
168168

169169
name = "router-${each.value["cluster_name"]}-${random_id.rand.hex}"

examples/island_cluster_with_vm_router/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ resource "google_service_account" "gke-sa" {
2525

2626
module "net" {
2727
source = "terraform-google-modules/network/google"
28-
version = "~> 10.0"
28+
version = "~> 11.0"
2929

3030
network_name = "gke-net-${random_id.rand.hex}"
3131
routing_mode = "GLOBAL"

examples/safer_cluster_iap_bastion/network.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
module "vpc" {
1919
source = "terraform-google-modules/network/google"
20-
version = "~> 10.0"
20+
version = "~> 11.0"
2121

2222
project_id = module.enabled_google_apis.project_id
2323
network_name = var.network_name

examples/simple_autopilot_private/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ module "gke" {
5050
enable_private_endpoint = true
5151
enable_private_nodes = true
5252
network_tags = [local.cluster_type]
53-
node_pools_cgroup_mode = "CGROUP_MODE_V2"
53+
# TODO: b/413643369
54+
# node_pools_cgroup_mode = "CGROUP_MODE_V2"
5455
deletion_protection = false
5556
insecure_kubelet_readonly_port_enabled = false
5657
}

0 commit comments

Comments
 (0)