From e5d9649ac9bd11eaef359217e3a055f2f75bf58a Mon Sep 17 00:00:00 2001 From: David Bellemare Date: Sat, 25 Apr 2026 20:59:47 -0400 Subject: [PATCH] feat(gke): add gpuSharing field to ComputeClass GPU spec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the CloudGoogleComV1ComputeClassSpecPrioritiesItems0GpuSharing schema and wire it into the Gpu priorities schema. This exposes the GPU sharing and MIG partitioning support added in GKE 1.35.2-gke.1485000. New fields under spec.priorities[].gpu.gpuSharing: - sharingStrategy: TIME_SHARING or MPS - maxSharedClientsPerGPU: 2–48 (required with a sharing strategy) - gpuPartitionSize: MIG profile string, e.g. "1g.24gb" Ref: https://cloud.google.com/kubernetes-engine/docs/reference/crds/computeclass Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: David Bellemare --- gke/kcl.mod | 4 +-- gke/v1/cloud_google_com_v1_compute_class.k | 39 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/gke/kcl.mod b/gke/kcl.mod index 587ffc58..6c9e6a60 100644 --- a/gke/kcl.mod +++ b/gke/kcl.mod @@ -1,7 +1,7 @@ [package] name = "gke" -edition = "v0.11.3" -version = "0.0.3" +edition = "v0.11.4" +version = "0.0.4" [dependencies] k8s = "1.32.4" diff --git a/gke/v1/cloud_google_com_v1_compute_class.k b/gke/v1/cloud_google_com_v1_compute_class.k index 171569bf..db937163 100644 --- a/gke/v1/cloud_google_com_v1_compute_class.k +++ b/gke/v1/cloud_google_com_v1_compute_class.k @@ -245,6 +245,40 @@ schema CloudGoogleComV1ComputeClassSpecPrioritiesItems0: minMemoryGb >= 0 if minMemoryGb not in [None, Undefined] +schema CloudGoogleComV1ComputeClassSpecPrioritiesItems0GpuSharing: + r""" + GpuSharing defines GPU sharing and partitioning config for a node. + Requires GKE version 1.35.2-gke.1485000 or later. + + Attributes + ---------- + sharingStrategy : str, default is Undefined, optional + SharingStrategy describes the GPU sharing strategy. + Supported values: TIME_SHARING, MPS. + maxSharedClientsPerGPU : int, default is Undefined, optional + MaxSharedClientsPerGPU describes the maximum number of containers + that can share a GPU. Valid range: 2-48. + Required when sharingStrategy is set. + gpuPartitionSize : str, default is Undefined, optional + GpuPartitionSize enables multi-instance GPU (MIG) partitioning. + Sets the MIG profile applied to each GPU on the node. + Example values for nvidia-rtx-pro-6000: "1g.24gb", "2g.48gb", "4g.96gb". + Example values for nvidia-h100-80gb: "1g.10gb", "2g.20gb", "3g.40gb", "4g.40gb", "7g.80gb". + If omitted the GPU is not partitioned. + """ + + sharingStrategy?: str + + maxSharedClientsPerGPU?: int + + gpuPartitionSize?: str + + + check: + maxSharedClientsPerGPU >= 2 if maxSharedClientsPerGPU not in [None, Undefined] + maxSharedClientsPerGPU <= 48 if maxSharedClientsPerGPU not in [None, Undefined] + + schema CloudGoogleComV1ComputeClassSpecPrioritiesItems0Gpu: r""" Gpu defines preferred GPU config for a node. @@ -257,6 +291,9 @@ schema CloudGoogleComV1ComputeClassSpecPrioritiesItems0Gpu: DriverVersion describes version of GPU driver for a node. $type : str, default is Undefined, optional Type describes preferred GPU accelerator type for a node. + gpuSharing : CloudGoogleComV1ComputeClassSpecPrioritiesItems0GpuSharing, default is Undefined, optional + GpuSharing configures GPU sharing strategies and MIG partitioning. + Requires GKE version 1.35.2-gke.1485000 or later. """ @@ -266,6 +303,8 @@ schema CloudGoogleComV1ComputeClassSpecPrioritiesItems0Gpu: $type?: str + gpuSharing?: CloudGoogleComV1ComputeClassSpecPrioritiesItems0GpuSharing + check: count >= 1 if count not in [None, Undefined]