Skip to content

Commit 721983b

Browse files
authored
Merge pull request GoogleCloudPlatform#4739 from kadupoornima/numa-ff
Add NUMA-aware scheduling in GKE clusters (enabled for G4)
2 parents 4f8b592 + 4cb5f58 commit 721983b

4 files changed

Lines changed: 24 additions & 0 deletions

File tree

examples/gke-g4/gke-g4.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ deployment_groups:
122122
system_node_pool_taints: []
123123
enable_dcgm_monitoring: true
124124
enable_private_endpoint: false # Allows access from authorized public IPs
125+
enable_numa_aware_scheduling: true
125126
configure_workload_identity_sa: true
126127
master_authorized_networks:
127128
- cidr_block: $(vars.authorized_cidr) # Allows your machine to run the kubectl command. Required for multi network setup.

modules/scheduler/gke-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ limitations under the License.
155155
| <a name="input_enable_master_global_access"></a> [enable\_master\_global\_access](#input\_enable\_master\_global\_access) | Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `false` | no |
156156
| <a name="input_enable_multi_networking"></a> [enable\_multi\_networking](#input\_enable\_multi\_networking) | Enables [multi networking](https://cloud.google.com/kubernetes-engine/docs/how-to/setup-multinetwork-support-for-pods#create-a-gke-cluster) (Requires GKE Enterprise). This setting is immutable on clusters and enables [Dataplane V2](https://cloud.google.com/kubernetes-engine/docs/concepts/dataplane-v2?hl=en). If null, will determine state based on if additional\_networks are passed in. | `bool` | `null` | no |
157157
| <a name="input_enable_node_local_dns_cache"></a> [enable\_node\_local\_dns\_cache](#input\_enable\_node\_local\_dns\_cache) | Enable GKE NodeLocal DNSCache addon to improve DNS lookup latency | `bool` | `false` | no |
158+
| <a name="input_enable_numa_aware_scheduling"></a> [enable\_numa\_aware\_scheduling](#input\_enable\_numa\_aware\_scheduling) | Enable [NUMA-aware](https://cloud.google.com/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/numa) scheduling. | `bool` | `false` | no |
158159
| <a name="input_enable_parallelstore_csi"></a> [enable\_parallelstore\_csi](#input\_enable\_parallelstore\_csi) | The status of the Google Compute Engine Parallelstore Container Storage Interface (CSI) driver addon, which allows the usage of a parallelstore as volumes. | `bool` | `false` | no |
159160
| <a name="input_enable_persistent_disk_csi"></a> [enable\_persistent\_disk\_csi](#input\_enable\_persistent\_disk\_csi) | The status of the Google Compute Engine Persistent Disk Container Storage Interface (CSI) driver addon, which allows the usage of a PD as volumes. | `bool` | `true` | no |
160161
| <a name="input_enable_private_endpoint"></a> [enable\_private\_endpoint](#input\_enable\_private\_endpoint) | (Beta) Whether the master's internal IP address is used as the cluster endpoint. | `bool` | `true` | no |

modules/scheduler/gke-cluster/main.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,22 @@ resource "google_container_cluster" "gke_cluster" {
241241
enable_secure_boot = var.system_node_pool_enable_secure_boot
242242
enable_integrity_monitoring = true
243243
}
244+
245+
kubelet_config {
246+
cpu_manager_policy = var.enable_numa_aware_scheduling ? "static" : null
247+
dynamic "topology_manager" {
248+
for_each = var.enable_numa_aware_scheduling ? [1] : []
249+
content {
250+
policy = "restricted"
251+
}
252+
}
253+
dynamic "memory_manager" {
254+
for_each = var.enable_numa_aware_scheduling ? [1] : []
255+
content {
256+
policy = "Static"
257+
}
258+
}
259+
}
244260
}
245261

246262
control_plane_endpoints_config {

modules/scheduler/gke-cluster/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,3 +525,9 @@ variable "enable_external_dns_endpoint" {
525525
type = bool
526526
default = false
527527
}
528+
529+
variable "enable_numa_aware_scheduling" {
530+
description = "Enable [NUMA-aware](https://cloud.google.com/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/numa) scheduling."
531+
type = bool
532+
default = false
533+
}

0 commit comments

Comments
 (0)