@@ -125,12 +125,15 @@ type NIMServiceSpec struct {
125125 SchedulerName string `json:"schedulerName,omitempty"`
126126 Metrics Metrics `json:"metrics,omitempty"`
127127 // +kubebuilder:validation:Minimum=0
128- Replicas * int32 `json:"replicas,omitempty"`
129- UserID * int64 `json:"userID,omitempty"`
130- GroupID * int64 `json:"groupID,omitempty"`
131- RuntimeClassName string `json:"runtimeClassName,omitempty"`
132- Proxy * ProxySpec `json:"proxy,omitempty"`
133- MultiNode * NimServiceMultiNodeConfig `json:"multiNode,omitempty"`
128+ Replicas * int32 `json:"replicas,omitempty"`
129+ UserID * int64 `json:"userID,omitempty"`
130+ GroupID * int64 `json:"groupID,omitempty"`
131+ RuntimeClassName string `json:"runtimeClassName,omitempty"`
132+ // PriorityClassName is the name of the PriorityClass to assign to pods created by this NIMService.
133+ // If set, the Kubernetes scheduler uses the priority for preemption decisions.
134+ PriorityClassName string `json:"priorityClassName,omitempty"`
135+ Proxy * ProxySpec `json:"proxy,omitempty"`
136+ MultiNode * NimServiceMultiNodeConfig `json:"multiNode,omitempty"`
134137 // InferencePlatform specifies the inference platform to use for this NIMService.
135138 // Valid values are "standalone" (default) and "kserve".
136139 // +kubebuilder:validation:Enum=standalone;kserve
@@ -1249,6 +1252,9 @@ func (n *NIMService) GetDeploymentParams() *rendertypes.DeploymentParams {
12491252 // Set scheduler
12501253 params .SchedulerName = n .GetSchedulerName ()
12511254
1255+ // Set priority class
1256+ params .PriorityClassName = n .GetPriorityClassName ()
1257+
12521258 // Setup container ports for nimservice
12531259 params .Ports = []corev1.ContainerPort {
12541260 {
@@ -1333,6 +1339,7 @@ func (n *NIMService) GetLWSParams() *rendertypes.LeaderWorkerSetParams {
13331339 params .ServiceAccountName = n .GetServiceAccountName ()
13341340 params .SchedulerName = n .GetSchedulerName ()
13351341 params .RuntimeClassName = n .GetRuntimeClassName ()
1342+ params .PriorityClassName = n .GetPriorityClassName ()
13361343
13371344 params .InitContainers = n .GetInitContainers ()
13381345 for idx := range params .InitContainers {
@@ -1350,6 +1357,11 @@ func (n *NIMService) GetSchedulerName() string {
13501357 return n .Spec .SchedulerName
13511358}
13521359
1360+ // GetPriorityClassName returns the priority class for the NIMService deployment.
1361+ func (n * NIMService ) GetPriorityClassName () string {
1362+ return n .Spec .PriorityClassName
1363+ }
1364+
13531365// GetStatefulSetParams returns params to render StatefulSet from templates.
13541366func (n * NIMService ) GetStatefulSetParams () * rendertypes.StatefulSetParams {
13551367
@@ -1393,6 +1405,9 @@ func (n *NIMService) GetStatefulSetParams() *rendertypes.StatefulSetParams {
13931405
13941406 // Set runtime class
13951407 params .RuntimeClassName = n .GetRuntimeClassName ()
1408+
1409+ // Set priority class
1410+ params .PriorityClassName = n .GetPriorityClassName ()
13961411 return params
13971412}
13981413
@@ -1846,6 +1861,9 @@ func (n *NIMService) GetInferenceServiceParams(
18461861 // Set scheduler
18471862 params .SchedulerName = n .GetSchedulerName ()
18481863
1864+ // Set priority class
1865+ params .PriorityClassName = n .GetPriorityClassName ()
1866+
18491867 params .Ports = n .GetInferenceServicePorts (deploymentMode )
18501868
18511869 params .InitContainers = n .GetInitContainers ()
0 commit comments