Skip to content

Commit 17e1c71

Browse files
authored
feat: add new kubelet params (#2337)
Signed-off-by: drfaust92 <[email protected]>
1 parent e2435cf commit 17e1c71

File tree

16 files changed

+240
-23
lines changed

16 files changed

+240
-23
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,13 @@ The node_pools variable takes the following parameters:
321321
| 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 |
322322
| 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 |
323323
| 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 |
324+
| container_log_max_size | Defines the maximum size of the container log file before it is rotated. | null | Optional |
325+
| container_log_max_files | Defines the maximum number of container log files that can be present for a container. | null | Optional |
326+
| 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 |
327+
| image_gc_high_threshold_percent | Defines the percent of disk usage after which image garbage collection is always run. | null | Optional |
328+
| image_minimum_gc_age | Defines the minimum age for an unused image before it is garbage collected. | null | Optional |
329+
| image_maximum_gc_age | Defines the maximum age an image can be unused before it is garbage collected. | null | Optional |
330+
| 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 |
324331
| enable_confidential_nodes | An optional flag to enable confidential node config. | false | Optional |
325332
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
326333
| 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

@@ -1163,7 +1177,7 @@ resource "google_container_node_pool" "windows_pools" {
11631177
dynamic "kubelet_config" {
11641178
for_each = length(setintersection(
11651179
keys(each.value),
1166-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "insecure_kubelet_readonly_port_enabled", "pod_pids_limit"]
1180+
["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"]
11671181
)) != 0 ? [1] : []
11681182

11691183
content {
@@ -1172,6 +1186,13 @@ resource "google_container_node_pool" "windows_pools" {
11721186
cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null)
11731187
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
11741188
pod_pids_limit = lookup(each.value, "pod_pids_limit", null)
1189+
container_log_max_size = lookup(each.value, "container_log_max_size", null)
1190+
container_log_max_files = lookup(each.value, "container_log_max_files", null)
1191+
image_gc_low_threshold_percent = lookup(each.value, "image_gc_low_threshold_percent", null)
1192+
image_gc_high_threshold_percent = lookup(each.value, "image_gc_high_threshold_percent", null)
1193+
image_minimum_gc_age = lookup(each.value, "image_minimum_gc_age", null)
1194+
image_maximum_gc_age = lookup(each.value, "image_maximum_gc_age", null)
1195+
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)]
11751196
}
11761197
}
11771198

modules/beta-private-cluster-update-variant/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,13 @@ The node_pools variable takes the following parameters:
375375
| 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 |
376376
| 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 |
377377
| 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 |
378+
| container_log_max_size | Defines the maximum size of the container log file before it is rotated. | null | Optional |
379+
| container_log_max_files | Defines the maximum number of container log files that can be present for a container. | null | Optional |
380+
| 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 |
381+
| image_gc_high_threshold_percent | Defines the percent of disk usage after which image garbage collection is always run. | null | Optional |
382+
| image_minimum_gc_age | Defines the minimum age for an unused image before it is garbage collected. | null | Optional |
383+
| image_maximum_gc_age | Defines the maximum age an image can be unused before it is garbage collected. | null | Optional |
384+
| 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 |
378385
| enable_confidential_nodes | An optional flag to enable confidential node config. | false | Optional |
379386
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
380387
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |

0 commit comments

Comments
 (0)