Skip to content

Commit eec38a2

Browse files
authored
feat: add pod_pids_limit for kubelet_config in all modules, example and autogen (#1922)
1 parent 6dd46d1 commit eec38a2

File tree

11 files changed

+24
-9
lines changed

11 files changed

+24
-9
lines changed

autogen/main/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ The node_pools variable takes the following parameters:
201201
| cpu_manager_policy | The CPU manager policy on the node. One of "none" or "static". | "static" | Optional |
202202
| 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 |
203203
| 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 |
204+
| 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 |
204205
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
205206
{% endif %}
206207
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |

autogen/main/cluster.tf.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,13 +985,14 @@ resource "google_container_node_pool" "windows_pools" {
985985
dynamic "kubelet_config" {
986986
for_each = length(setintersection(
987987
keys(each.value),
988-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period"]
988+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "pod_pids_limit"]
989989
)) != 0 ? [1] : []
990990

991991
content {
992992
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "static")
993993
cpu_cfs_quota = lookup(each.value, "cpu_cfs_quota", null)
994994
cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null)
995+
pod_pids_limit = lookup(each.value, "pod_pids_limit", null)
995996
}
996997
}
997998
{% endif %}

examples/node_pool/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ module "gke" {
7979
cpu_manager_policy = "static"
8080
cpu_cfs_quota = true
8181
local_ssd_ephemeral_count = 2
82+
pod_pids_limit = 4096
8283
},
8384
{
8485
name = "pool-04"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ The node_pools variable takes the following parameters:
352352
| cpu_manager_policy | The CPU manager policy on the node. One of "none" or "static". | "static" | Optional |
353353
| 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 |
354354
| 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 |
355+
| 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 |
355356
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
356357
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
357358
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |

modules/beta-private-cluster-update-variant/cluster.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,13 +868,14 @@ resource "google_container_node_pool" "pools" {
868868
dynamic "kubelet_config" {
869869
for_each = length(setintersection(
870870
keys(each.value),
871-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period"]
871+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "pod_pids_limit"]
872872
)) != 0 ? [1] : []
873873

874874
content {
875875
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "static")
876876
cpu_cfs_quota = lookup(each.value, "cpu_cfs_quota", null)
877877
cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null)
878+
pod_pids_limit = lookup(each.value, "pod_pids_limit", null)
878879
}
879880
}
880881

@@ -1153,13 +1154,14 @@ resource "google_container_node_pool" "windows_pools" {
11531154
dynamic "kubelet_config" {
11541155
for_each = length(setintersection(
11551156
keys(each.value),
1156-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period"]
1157+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "pod_pids_limit"]
11571158
)) != 0 ? [1] : []
11581159

11591160
content {
11601161
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "static")
11611162
cpu_cfs_quota = lookup(each.value, "cpu_cfs_quota", null)
11621163
cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null)
1164+
pod_pids_limit = lookup(each.value, "pod_pids_limit", null)
11631165
}
11641166
}
11651167

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ The node_pools variable takes the following parameters:
330330
| cpu_manager_policy | The CPU manager policy on the node. One of "none" or "static". | "static" | Optional |
331331
| 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 |
332332
| 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 |
333+
| 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 |
333334
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
334335
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
335336
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |

modules/beta-private-cluster/cluster.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,13 +789,14 @@ resource "google_container_node_pool" "pools" {
789789
dynamic "kubelet_config" {
790790
for_each = length(setintersection(
791791
keys(each.value),
792-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period"]
792+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "pod_pids_limit"]
793793
)) != 0 ? [1] : []
794794

795795
content {
796796
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "static")
797797
cpu_cfs_quota = lookup(each.value, "cpu_cfs_quota", null)
798798
cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null)
799+
pod_pids_limit = lookup(each.value, "pod_pids_limit", null)
799800
}
800801
}
801802

@@ -1073,13 +1074,14 @@ resource "google_container_node_pool" "windows_pools" {
10731074
dynamic "kubelet_config" {
10741075
for_each = length(setintersection(
10751076
keys(each.value),
1076-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period"]
1077+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "pod_pids_limit"]
10771078
)) != 0 ? [1] : []
10781079

10791080
content {
10801081
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "static")
10811082
cpu_cfs_quota = lookup(each.value, "cpu_cfs_quota", null)
10821083
cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null)
1084+
pod_pids_limit = lookup(each.value, "pod_pids_limit", null)
10831085
}
10841086
}
10851087

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ The node_pools variable takes the following parameters:
339339
| cpu_manager_policy | The CPU manager policy on the node. One of "none" or "static". | "static" | Optional |
340340
| 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 |
341341
| 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 |
342+
| 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 |
342343
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
343344
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
344345
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |

modules/beta-public-cluster-update-variant/cluster.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,13 +849,14 @@ resource "google_container_node_pool" "pools" {
849849
dynamic "kubelet_config" {
850850
for_each = length(setintersection(
851851
keys(each.value),
852-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period"]
852+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "pod_pids_limit"]
853853
)) != 0 ? [1] : []
854854

855855
content {
856856
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "static")
857857
cpu_cfs_quota = lookup(each.value, "cpu_cfs_quota", null)
858858
cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null)
859+
pod_pids_limit = lookup(each.value, "pod_pids_limit", null)
859860
}
860861
}
861862

@@ -1134,13 +1135,14 @@ resource "google_container_node_pool" "windows_pools" {
11341135
dynamic "kubelet_config" {
11351136
for_each = length(setintersection(
11361137
keys(each.value),
1137-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period"]
1138+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "pod_pids_limit"]
11381139
)) != 0 ? [1] : []
11391140

11401141
content {
11411142
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "static")
11421143
cpu_cfs_quota = lookup(each.value, "cpu_cfs_quota", null)
11431144
cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null)
1145+
pod_pids_limit = lookup(each.value, "pod_pids_limit", null)
11441146
}
11451147
}
11461148

modules/beta-public-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ The node_pools variable takes the following parameters:
317317
| cpu_manager_policy | The CPU manager policy on the node. One of "none" or "static". | "static" | Optional |
318318
| 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 |
319319
| 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 |
320+
| 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 |
320321
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
321322
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
322323
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |

modules/beta-public-cluster/cluster.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,13 +770,14 @@ resource "google_container_node_pool" "pools" {
770770
dynamic "kubelet_config" {
771771
for_each = length(setintersection(
772772
keys(each.value),
773-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period"]
773+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "pod_pids_limit"]
774774
)) != 0 ? [1] : []
775775

776776
content {
777777
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "static")
778778
cpu_cfs_quota = lookup(each.value, "cpu_cfs_quota", null)
779779
cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null)
780+
pod_pids_limit = lookup(each.value, "pod_pids_limit", null)
780781
}
781782
}
782783

@@ -1054,13 +1055,14 @@ resource "google_container_node_pool" "windows_pools" {
10541055
dynamic "kubelet_config" {
10551056
for_each = length(setintersection(
10561057
keys(each.value),
1057-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period"]
1058+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "pod_pids_limit"]
10581059
)) != 0 ? [1] : []
10591060

10601061
content {
10611062
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "static")
10621063
cpu_cfs_quota = lookup(each.value, "cpu_cfs_quota", null)
10631064
cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null)
1065+
pod_pids_limit = lookup(each.value, "pod_pids_limit", null)
10641066
}
10651067
}
10661068

0 commit comments

Comments
 (0)