Skip to content

Commit 721f846

Browse files
authored
feat: Add option for CPU manager policy (#749)
1 parent 4a85321 commit 721f846

File tree

13 files changed

+63
-16
lines changed

13 files changed

+63
-16
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ The node_pools variable takes the following parameters:
209209
| --- | --- | --- | --- |
210210
| accelerator_count | The number of the guest accelerator cards exposed to this instance | 0 | Optional |
211211
| accelerator_type | The accelerator type resource to expose to the instance | " " | Optional |
212-
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
213-
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
214212
| auto_repair | Whether the nodes will be automatically repaired | true | Optional |
215213
| autoscaling | Configuration required by cluster autoscaler to adjust the size of the node pool to the current cluster usage | true | Optional |
216214
| auto_upgrade | Whether the nodes will be automatically upgraded | true (if cluster is regional) | Optional |
217215
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
218216
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
219217
| effect | Effect for the taint | | Required |
218+
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
219+
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
220220
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS | Optional |
221221
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
222222
| key | The key required for the taint | | Required |

autogen/main/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,17 @@ The node_pools variable takes the following parameters:
158158
| --- | --- | --- | --- |
159159
| accelerator_count | The number of the guest accelerator cards exposed to this instance | 0 | Optional |
160160
| accelerator_type | The accelerator type resource to expose to the instance | " " | Optional |
161-
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
162-
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
163161
| auto_repair | Whether the nodes will be automatically repaired | true | Optional |
164162
| autoscaling | Configuration required by cluster autoscaler to adjust the size of the node pool to the current cluster usage | true | Optional |
165163
| auto_upgrade | Whether the nodes will be automatically upgraded | true (if cluster is regional) | Optional |
164+
{% if beta_cluster %}
165+
| cpu_manager_policy | The CPU manager policy on the node. One of "none" or "static". | "none" | Optional |
166+
{% endif %}
166167
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
167168
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
168169
| effect | Effect for the taint | | Required |
170+
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
171+
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
169172
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS | Optional |
170173
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
171174
| key | The key required for the taint | | Required |

autogen/main/cluster.tf.tmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,14 @@ resource "google_container_node_pool" "pools" {
527527
}
528528

529529
boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")
530+
531+
dynamic "kubelet_config" {
532+
for_each = contains(keys(each.value), "cpu_manager_policy") ? [1] : []
533+
534+
content {
535+
cpu_manager_policy = lookup(each.value, "cpu_manager_policy")
536+
}
537+
}
530538
{% endif %}
531539

532540
shielded_instance_config {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,15 @@ The node_pools variable takes the following parameters:
272272
| --- | --- | --- | --- |
273273
| accelerator_count | The number of the guest accelerator cards exposed to this instance | 0 | Optional |
274274
| accelerator_type | The accelerator type resource to expose to the instance | " " | Optional |
275-
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
276-
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
277275
| auto_repair | Whether the nodes will be automatically repaired | true | Optional |
278276
| autoscaling | Configuration required by cluster autoscaler to adjust the size of the node pool to the current cluster usage | true | Optional |
279277
| auto_upgrade | Whether the nodes will be automatically upgraded | true (if cluster is regional) | Optional |
278+
| cpu_manager_policy | The CPU manager policy on the node. One of "none" or "static". | "none" | Optional |
280279
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
281280
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
282281
| effect | Effect for the taint | | Required |
282+
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
283+
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
283284
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS | Optional |
284285
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
285286
| key | The key required for the taint | | Required |

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,14 @@ resource "google_container_node_pool" "pools" {
484484

485485
boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")
486486

487+
dynamic "kubelet_config" {
488+
for_each = contains(keys(each.value), "cpu_manager_policy") ? [1] : []
489+
490+
content {
491+
cpu_manager_policy = lookup(each.value, "cpu_manager_policy")
492+
}
493+
}
494+
487495
shielded_instance_config {
488496
enable_secure_boot = lookup(each.value, "enable_secure_boot", false)
489497
enable_integrity_monitoring = lookup(each.value, "enable_integrity_monitoring", true)

modules/beta-private-cluster/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,15 @@ The node_pools variable takes the following parameters:
250250
| --- | --- | --- | --- |
251251
| accelerator_count | The number of the guest accelerator cards exposed to this instance | 0 | Optional |
252252
| accelerator_type | The accelerator type resource to expose to the instance | " " | Optional |
253-
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
254-
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
255253
| auto_repair | Whether the nodes will be automatically repaired | true | Optional |
256254
| autoscaling | Configuration required by cluster autoscaler to adjust the size of the node pool to the current cluster usage | true | Optional |
257255
| auto_upgrade | Whether the nodes will be automatically upgraded | true (if cluster is regional) | Optional |
256+
| cpu_manager_policy | The CPU manager policy on the node. One of "none" or "static". | "none" | Optional |
258257
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
259258
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
260259
| effect | Effect for the taint | | Required |
260+
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
261+
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
261262
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS | Optional |
262263
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
263264
| key | The key required for the taint | | Required |

modules/beta-private-cluster/cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,14 @@ resource "google_container_node_pool" "pools" {
412412

413413
boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")
414414

415+
dynamic "kubelet_config" {
416+
for_each = contains(keys(each.value), "cpu_manager_policy") ? [1] : []
417+
418+
content {
419+
cpu_manager_policy = lookup(each.value, "cpu_manager_policy")
420+
}
421+
}
422+
415423
shielded_instance_config {
416424
enable_secure_boot = lookup(each.value, "enable_secure_boot", false)
417425
enable_integrity_monitoring = lookup(each.value, "enable_integrity_monitoring", true)

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,15 @@ The node_pools variable takes the following parameters:
259259
| --- | --- | --- | --- |
260260
| accelerator_count | The number of the guest accelerator cards exposed to this instance | 0 | Optional |
261261
| accelerator_type | The accelerator type resource to expose to the instance | " " | Optional |
262-
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
263-
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
264262
| auto_repair | Whether the nodes will be automatically repaired | true | Optional |
265263
| autoscaling | Configuration required by cluster autoscaler to adjust the size of the node pool to the current cluster usage | true | Optional |
266264
| auto_upgrade | Whether the nodes will be automatically upgraded | true (if cluster is regional) | Optional |
265+
| cpu_manager_policy | The CPU manager policy on the node. One of "none" or "static". | "none" | Optional |
267266
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
268267
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
269268
| effect | Effect for the taint | | Required |
269+
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
270+
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
270271
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS | Optional |
271272
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
272273
| key | The key required for the taint | | Required |

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,14 @@ resource "google_container_node_pool" "pools" {
465465

466466
boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")
467467

468+
dynamic "kubelet_config" {
469+
for_each = contains(keys(each.value), "cpu_manager_policy") ? [1] : []
470+
471+
content {
472+
cpu_manager_policy = lookup(each.value, "cpu_manager_policy")
473+
}
474+
}
475+
468476
shielded_instance_config {
469477
enable_secure_boot = lookup(each.value, "enable_secure_boot", false)
470478
enable_integrity_monitoring = lookup(each.value, "enable_integrity_monitoring", true)

modules/beta-public-cluster/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,15 @@ The node_pools variable takes the following parameters:
237237
| --- | --- | --- | --- |
238238
| accelerator_count | The number of the guest accelerator cards exposed to this instance | 0 | Optional |
239239
| accelerator_type | The accelerator type resource to expose to the instance | " " | Optional |
240-
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
241-
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
242240
| auto_repair | Whether the nodes will be automatically repaired | true | Optional |
243241
| autoscaling | Configuration required by cluster autoscaler to adjust the size of the node pool to the current cluster usage | true | Optional |
244242
| auto_upgrade | Whether the nodes will be automatically upgraded | true (if cluster is regional) | Optional |
243+
| cpu_manager_policy | The CPU manager policy on the node. One of "none" or "static". | "none" | Optional |
245244
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
246245
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
247246
| effect | Effect for the taint | | Required |
247+
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
248+
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
248249
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS | Optional |
249250
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
250251
| key | The key required for the taint | | Required |

0 commit comments

Comments
 (0)