Skip to content

Commit 3dba1f2

Browse files
committed
Using helm charts for kueue installation
This commit refactors the Kueue scheduler installation, migrating it from manually managed static YAML files to the official Kueue Helm chart.
1 parent ec1efd1 commit 3dba1f2

12 files changed

Lines changed: 70 additions & 53698 deletions

File tree

examples/gke-a3-highgpu.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ vars:
2525
# The following line must be updated for this example to work.
2626
authorized_cidr: <your-ip-address>/32
2727
gcp_public_cidrs_access_enabled: false
28+
system_node_pool_disk_size_gb: 200
2829

2930
deployment_groups:
3031
- group: primary
@@ -80,6 +81,9 @@ deployment_groups:
8081
source: modules/scheduler/gke-cluster
8182
use: [network1, gpunets, workload_service_account]
8283
settings:
84+
system_node_pool_machine_type: "e2-standard-16"
85+
system_node_pool_disk_size_gb: $(vars.system_node_pool_disk_size_gb)
86+
system_node_pool_taints: []
8387
enable_private_endpoint: false # Allows for access from authorized public IPs
8488
gcp_public_cidrs_access_enabled: $(vars.gcp_public_cidrs_access_enabled)
8589
configure_workload_identity_sa: true

examples/gke-a3-megagpu/gke-a3-megagpu.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ vars:
5454
health_check_schedule: "0 0 * * 0" # Run the health check at 12:00 AM (midnight) every Sunday
5555

5656
permissions_file_staged_path: $(ghpc_stage("./chs-permissions.yaml.tftpl"))
57+
system_node_pool_disk_size_gb: 200
5758
chs_output_bucket_name: chs-result
5859
chs_pvc_claim_name: chs-output-pvc
5960
chs_cronjob_rendered_path: $(ghpc_stage("./chs-cronjob.yaml.tftpl"))
@@ -114,6 +115,9 @@ deployment_groups:
114115
source: modules/scheduler/gke-cluster
115116
use: [network1, gpunets, workload_service_account]
116117
settings:
118+
system_node_pool_machine_type: "e2-standard-16"
119+
system_node_pool_disk_size_gb: $(vars.system_node_pool_disk_size_gb)
120+
system_node_pool_taints: []
117121
enable_private_endpoint: false # Allows for access from authorized public IPs
118122
gcp_public_cidrs_access_enabled: $(vars.gcp_public_cidrs_access_enabled)
119123
configure_workload_identity_sa: true

modules/management/kubectl-apply/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ limitations under the License.
207207
| <a name="module_install_gib"></a> [install\_gib](#module\_install\_gib) | ./kubectl | n/a |
208208
| <a name="module_install_gpu_operator"></a> [install\_gpu\_operator](#module\_install\_gpu\_operator) | ./helm_install | n/a |
209209
| <a name="module_install_jobset"></a> [install\_jobset](#module\_install\_jobset) | ./kubectl | n/a |
210-
| <a name="module_install_kueue"></a> [install\_kueue](#module\_install\_kueue) | ./kubectl | n/a |
210+
| <a name="module_install_kueue"></a> [install\_kueue](#module\_install\_kueue) | ./helm_install | n/a |
211211
| <a name="module_install_nvidia_dra_driver"></a> [install\_nvidia\_dra\_driver](#module\_install\_nvidia\_dra\_driver) | ./helm_install | n/a |
212212
| <a name="module_kubectl_apply_manifests"></a> [kubectl\_apply\_manifests](#module\_kubectl\_apply\_manifests) | ./kubectl | n/a |
213213

@@ -233,7 +233,7 @@ limitations under the License.
233233
| <a name="input_gke_cluster_exists"></a> [gke\_cluster\_exists](#input\_gke\_cluster\_exists) | A static flag that signals to downstream modules that a cluster has been created. Needed by community/modules/scripts/kubernetes-operations. | `bool` | `false` | no |
234234
| <a name="input_gpu_operator"></a> [gpu\_operator](#input\_gpu\_operator) | Install [GPU Operator](https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/latest/getting-started.html) which uses the [Kubernetes operator](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) to automate the management of all NVIDIA software components needed to provision GPU. | <pre>object({<br/> install = optional(bool, false)<br/> version = optional(string, "v25.3.0")<br/> })</pre> | `{}` | no |
235235
| <a name="input_jobset"></a> [jobset](#input\_jobset) | Install [Jobset](https://github.com/kubernetes-sigs/jobset) which manages a group of K8s [jobs](https://kubernetes.io/docs/concepts/workloads/controllers/job/) as a unit. | <pre>object({<br/> install = optional(bool, false)<br/> version = optional(string, "v0.7.2")<br/> })</pre> | `{}` | no |
236-
| <a name="input_kueue"></a> [kueue](#input\_kueue) | Install and configure [Kueue](https://kueue.sigs.k8s.io/docs/overview/) workload scheduler. A configuration yaml/template file can be provided with config\_path to be applied right after kueue installation. If a template file provided, its variables can be set to config\_template\_vars. | <pre>object({<br/> install = optional(bool, false)<br/> version = optional(string, "v0.12.2")<br/> config_path = optional(string, null)<br/> config_template_vars = optional(map(any), null)<br/> })</pre> | `{}` | no |
236+
| <a name="input_kueue"></a> [kueue](#input\_kueue) | Install and configure [Kueue](https://kueue.sigs.k8s.io/docs/overview/) workload scheduler. A configuration yaml/template file can be provided with config\_path to be applied right after kueue installation. If a template file provided, its variables can be set to config\_template\_vars. | <pre>object({<br/> install = optional(bool, false)<br/> version = optional(string, "0.13.3")<br/> config_path = optional(string, null)<br/> config_template_vars = optional(map(any), null)<br/> })</pre> | `{}` | no |
237237
| <a name="input_nvidia_dra_driver"></a> [nvidia\_dra\_driver](#input\_nvidia\_dra\_driver) | Installs [Nvidia DRA driver](https://github.com/NVIDIA/k8s-dra-driver-gpu) which supports Dynamic Resource Allocation for NVIDIA GPUs in Kubernetes | <pre>object({<br/> install = optional(bool, false)<br/> version = optional(string, "v25.3.0")<br/> })</pre> | `{}` | no |
238238
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | The project ID that hosts the gke cluster. | `string` | n/a | yes |
239239

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright 2025 "Google LLC"
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# For referencing the original Kueue helm chart values, pull the latest helm chart version
16+
# `helm pull oci://registry.k8s.io/kueue/charts/kueue --version=0.13.3` (latest helm chart version)
17+
18+
controllerManager:
19+
# -- Enables the Topology-Aware Scheduling feature gate.
20+
featureGates:
21+
- name: TopologyAwareScheduling
22+
enabled: true
23+
24+
# It ensures the Kueue pod can schedule on GKE clusters where the
25+
# system node pool uses the default "gke-managed-components" taint.
26+
tolerations:
27+
- key: "components.gke.io/gke-managed-components"
28+
operator: "Equal"
29+
value: "true"
30+
effect: "NoSchedule"

modules/management/kubectl-apply/main.tf

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ locals {
5353
install_gpu_operator = try(var.gpu_operator.install, false)
5454
install_nvidia_dra_driver = try(var.nvidia_dra_driver.install, false)
5555
install_gib = try(var.gib.install, false)
56-
kueue_install_source = format("${path.module}/manifests/kueue-%s.yaml", try(var.kueue.version, ""))
5756
jobset_install_source = format("${path.module}/manifests/jobset-%s.yaml", try(var.jobset.version, ""))
5857
}
5958

@@ -87,15 +86,21 @@ module "kubectl_apply_manifests" {
8786
}
8887

8988
module "install_kueue" {
90-
source = "./kubectl"
91-
source_path = local.install_kueue ? local.kueue_install_source : null
92-
server_side_apply = true
93-
wait_for_rollout = true
94-
depends_on = [var.gke_cluster_exists]
89+
source = "./helm_install"
90+
count = local.install_kueue ? 1 : 0
91+
wait = false
92+
timeout = 1200
93+
release_name = "kueue"
94+
chart_repository = "oci://registry.k8s.io/kueue/charts"
95+
chart_name = "kueue"
96+
chart_version = var.kueue.version
97+
namespace = "kueue-system"
98+
create_namespace = true
99+
values_yaml = [
100+
file("${path.module}/kueue/kueue-helm-values.yaml")
101+
]
95102

96-
providers = {
97-
kubectl = kubectl
98-
}
103+
depends_on = [var.gke_cluster_exists]
99104
}
100105

101106
module "configure_kueue" {

0 commit comments

Comments
 (0)