Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changes/unreleased/Added-20260805-142800.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
kind: Added
body: Add PriorityClassName, GoMemLimit(Ratio) and ExtendedResourceClaimAllocation types
6 changes: 6 additions & 0 deletions kai/v1/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ type GlobalConfig struct {
// +kubebuilder:validation:Optional
DaemonsetsTolerations []v1.Toleration `json:"daemonsetsTolerations,omitempty"`

// PriorityClassName defines the priority class for KAI operators & services.
// An empty value leaves the pods without a priority class.
// +kubebuilder:validation:Optional
PriorityClassName *string `json:"priorityClassName,omitempty"`

// ReplicaCount specifies the number of replicas of services that have no specific replicas configuration
// +kubebuilder:validation:Optional
ReplicaCount *int32 `json:"replicaCount,omitempty"`
Expand Down Expand Up @@ -130,6 +135,7 @@ func (g *GlobalConfig) SetDefaultWhereNeeded() {

g.RequireDefaultPodAntiAffinityTerm = common.SetDefault(g.RequireDefaultPodAntiAffinityTerm, ptr.To(false))
g.JSONLog = common.SetDefault(g.JSONLog, ptr.To(false))
g.PriorityClassName = common.SetDefault(g.PriorityClassName, ptr.To(""))

if g.VPA == nil {
g.VPA = &common.VPASpec{}
Expand Down
15 changes: 15 additions & 0 deletions kai/v1/schedulingshard_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"strconv"
"time"

"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"

Expand Down Expand Up @@ -95,6 +96,18 @@ type SchedulingShardSpec struct {
// +kubebuilder:validation:Optional
Args map[string]string `json:"args,omitempty"`

// GoMemLimitRatio is the fraction of the scheduler container memory limit
// applied as GOMEMLIMIT. Defaults to 0.9.
// +kubebuilder:validation:Optional
// +kubebuilder:validation:ExclusiveMinimum=true
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=1
GoMemLimitRatio *float64 `json:"goMemLimitRatio,omitempty"`

// GoMemLimit overrides automatic cgroup-derived GOMEMLIMIT for this shard.
// +kubebuilder:validation:Optional
GoMemLimit *resource.Quantity `json:"goMemLimit,omitempty"`

// PlacementStrategy is the placement scheduler strategy
// +kubebuilder:validation:Optional
PlacementStrategy *PlacementStrategy `json:"placementStrategy,omitempty"`
Expand Down Expand Up @@ -146,6 +159,8 @@ type SchedulingShardSpec struct {
}

func (s *SchedulingShardSpec) SetDefaultsWhereNeeded() {
s.GoMemLimitRatio = common.SetDefault(s.GoMemLimitRatio, ptr.To(0.9))

s.PlacementStrategy = common.SetDefault(s.PlacementStrategy, &PlacementStrategy{})
s.PlacementStrategy.SetDefaultWhereNeeded()

Expand Down
15 changes: 15 additions & 0 deletions kai/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 20 additions & 2 deletions scheduling/v1alpha2/bindrequest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
package v1alpha2

import (
v1 "k8s.io/api/resource/v1"
corev1 "k8s.io/api/core/v1"
resourceapi "k8s.io/api/resource/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand All @@ -29,6 +30,10 @@ type BindRequestSpec struct {
// ResourceClaims is the list of resource claims that need to be bound for this pod
ResourceClaimAllocations []ResourceClaimAllocation `json:"resourceClaimAllocations,omitempty"`

// ExtendedResourceClaimAllocation holds the allocation for the synthetic DRA claim
// created to satisfy extended resource requests backed by a DeviceClass.
ExtendedResourceClaimAllocation *ExtendedResourceClaimAllocation `json:"extendedResourceClaimAllocation,omitempty"`

// PredictedNUMAZones is the scheduler's predicted NUMA placement of the pod's resources on the
// selected node.
PredictedNUMAZones []NUMAZonePlacement `json:"predictedNUMAZones,omitempty"`
Expand All @@ -51,7 +56,20 @@ type ResourceClaimAllocation struct {
Name string `json:"name,omitempty"`

// Allocation is the desired allocation of the resource claim
Allocation *v1.AllocationResult `json:"allocation,omitempty"`
Allocation *resourceapi.AllocationResult `json:"allocation,omitempty"`
}

// ExtendedResourceClaimAllocation carries the scheduler's allocation decision for
// the synthetic ResourceClaim created to back DRA-extended-resource requests.
type ExtendedResourceClaimAllocation struct {
// Allocation is the allocation result from the DRA allocator.
Allocation *resourceapi.AllocationResult `json:"allocation,omitempty"`

// DeviceRequests are the per-container device requests placed in the claim Spec.
DeviceRequests []resourceapi.DeviceRequest `json:"deviceRequests,omitempty"`

// ContainerMappings maps each container's extended resource request to a DeviceRequest name.
ContainerMappings []corev1.ContainerExtendedResourceRequest `json:"containerMappings,omitempty"`
}

const (
Expand Down
41 changes: 39 additions & 2 deletions scheduling/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading