Update the API of schedule priroity feature as per the MVP version

Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
This commit is contained in:
RainbowMango 2025-02-28 11:32:25 +08:00
parent 83a38a8d05
commit 962d56ff08
5 changed files with 10 additions and 21 deletions

View File

@ -19302,12 +19302,14 @@
], ],
"properties": { "properties": {
"priorityClassName": { "priorityClassName": {
"description": "PriorityClassName specifies which PriorityClass to use. Its behavior depends on PriorityClassSource:\n\nBehavior of PriorityClassName:\n\nFor KubePriorityClass: - When specified: Uses the named Kubernetes PriorityClass. - When empty: Uses the cluster's default PriorityClass (i.e., the PriorityClass marked as the global default in the cluster). - If neither exists: Sets priority=0 and preemptionPolicy=Never.\n\nFor PodPriorityClass: - Uses PriorityClassName from the PodTemplate. - If the specified PriorityClass is not found, falls back to the cluster's default PriorityClass\n (i.e., the PriorityClass marked as the global default in the cluster).\n- If no valid PriorityClass is found: Sets priority=0 and preemptionPolicy=Never. - Not yet implemented.\n\nFor FederatedPriorityClass: - Not yet implemented.", "description": "PriorityClassName specifies which PriorityClass to use. Its behavior depends on PriorityClassSource:\n\nBehavior of PriorityClassName:\n\nFor KubePriorityClass: - When specified: Uses the named Kubernetes PriorityClass.\n\nFor PodPriorityClass: - Uses PriorityClassName from the PodTemplate. - Not yet implemented.\n\nFor FederatedPriorityClass: - Not yet implemented.",
"type": "string" "type": "string",
"default": ""
}, },
"priorityClassSource": { "priorityClassSource": {
"description": "PriorityClassSource specifies where Karmada should look for the PriorityClass definition. Available options: - KubePriorityClass: Uses Kubernetes PriorityClass (scheduling.k8s.io/v1) - PodPriorityClass: Uses PriorityClassName from PodTemplate: PodSpec.PriorityClassName (not yet implemented) - FederatedPriorityClass: Uses Karmada FederatedPriorityClass (not yet implemented)", "description": "PriorityClassSource specifies where Karmada should look for the PriorityClass definition. Available options: - KubePriorityClass: Uses Kubernetes PriorityClass (scheduling.k8s.io/v1) - PodPriorityClass: Uses PriorityClassName from PodTemplate: PodSpec.PriorityClassName (not yet implemented) - FederatedPriorityClass: Uses Karmada FederatedPriorityClass (not yet implemented)",
"type": "string" "type": "string",
"default": ""
} }
} }
}, },

View File

@ -888,14 +888,9 @@ spec:
For KubePriorityClass: For KubePriorityClass:
- When specified: Uses the named Kubernetes PriorityClass. - When specified: Uses the named Kubernetes PriorityClass.
- When empty: Uses the cluster's default PriorityClass (i.e., the PriorityClass marked as the global default in the cluster).
- If neither exists: Sets priority=0 and preemptionPolicy=Never.
For PodPriorityClass: For PodPriorityClass:
- Uses PriorityClassName from the PodTemplate. - Uses PriorityClassName from the PodTemplate.
- If the specified PriorityClass is not found, falls back to the cluster's default PriorityClass
(i.e., the PriorityClass marked as the global default in the cluster).
- If no valid PriorityClass is found: Sets priority=0 and preemptionPolicy=Never.
- Not yet implemented. - Not yet implemented.
For FederatedPriorityClass: For FederatedPriorityClass:

View File

@ -885,14 +885,9 @@ spec:
For KubePriorityClass: For KubePriorityClass:
- When specified: Uses the named Kubernetes PriorityClass. - When specified: Uses the named Kubernetes PriorityClass.
- When empty: Uses the cluster's default PriorityClass (i.e., the PriorityClass marked as the global default in the cluster).
- If neither exists: Sets priority=0 and preemptionPolicy=Never.
For PodPriorityClass: For PodPriorityClass:
- Uses PriorityClassName from the PodTemplate. - Uses PriorityClassName from the PodTemplate.
- If the specified PriorityClass is not found, falls back to the cluster's default PriorityClass
(i.e., the PriorityClass marked as the global default in the cluster).
- If no valid PriorityClass is found: Sets priority=0 and preemptionPolicy=Never.
- Not yet implemented. - Not yet implemented.
For FederatedPriorityClass: For FederatedPriorityClass:

View File

@ -688,7 +688,7 @@ type SchedulePriority struct {
// //
// +kubebuilder:validation:Enum=KubePriorityClass // +kubebuilder:validation:Enum=KubePriorityClass
// +required // +required
PriorityClassSource PriorityClassSource `json:"priorityClassSource,omitempty"` PriorityClassSource PriorityClassSource `json:"priorityClassSource"`
// PriorityClassName specifies which PriorityClass to use. Its behavior depends on PriorityClassSource: // PriorityClassName specifies which PriorityClass to use. Its behavior depends on PriorityClassSource:
// //
@ -696,21 +696,16 @@ type SchedulePriority struct {
// //
// For KubePriorityClass: // For KubePriorityClass:
// - When specified: Uses the named Kubernetes PriorityClass. // - When specified: Uses the named Kubernetes PriorityClass.
// - When empty: Uses the cluster's default PriorityClass (i.e., the PriorityClass marked as the global default in the cluster).
// - If neither exists: Sets priority=0 and preemptionPolicy=Never.
// //
// For PodPriorityClass: // For PodPriorityClass:
// - Uses PriorityClassName from the PodTemplate. // - Uses PriorityClassName from the PodTemplate.
// - If the specified PriorityClass is not found, falls back to the cluster's default PriorityClass
// (i.e., the PriorityClass marked as the global default in the cluster).
// - If no valid PriorityClass is found: Sets priority=0 and preemptionPolicy=Never.
// - Not yet implemented. // - Not yet implemented.
// //
// For FederatedPriorityClass: // For FederatedPriorityClass:
// - Not yet implemented. // - Not yet implemented.
// //
// +required // +required
PriorityClassName string `json:"priorityClassName,omitempty"` PriorityClassName string `json:"priorityClassName"`
} }
// PriorityClassSource defines the type for PriorityClassSource field. // PriorityClassSource defines the type for PriorityClassSource field.

View File

@ -5151,13 +5151,15 @@ func schema_pkg_apis_policy_v1alpha1_SchedulePriority(ref common.ReferenceCallba
"priorityClassSource": { "priorityClassSource": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Description: "PriorityClassSource specifies where Karmada should look for the PriorityClass definition. Available options: - KubePriorityClass: Uses Kubernetes PriorityClass (scheduling.k8s.io/v1) - PodPriorityClass: Uses PriorityClassName from PodTemplate: PodSpec.PriorityClassName (not yet implemented) - FederatedPriorityClass: Uses Karmada FederatedPriorityClass (not yet implemented)", Description: "PriorityClassSource specifies where Karmada should look for the PriorityClass definition. Available options: - KubePriorityClass: Uses Kubernetes PriorityClass (scheduling.k8s.io/v1) - PodPriorityClass: Uses PriorityClassName from PodTemplate: PodSpec.PriorityClassName (not yet implemented) - FederatedPriorityClass: Uses Karmada FederatedPriorityClass (not yet implemented)",
Default: "",
Type: []string{"string"}, Type: []string{"string"},
Format: "", Format: "",
}, },
}, },
"priorityClassName": { "priorityClassName": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Description: "PriorityClassName specifies which PriorityClass to use. Its behavior depends on PriorityClassSource:\n\nBehavior of PriorityClassName:\n\nFor KubePriorityClass: - When specified: Uses the named Kubernetes PriorityClass. - When empty: Uses the cluster's default PriorityClass (i.e., the PriorityClass marked as the global default in the cluster). - If neither exists: Sets priority=0 and preemptionPolicy=Never.\n\nFor PodPriorityClass: - Uses PriorityClassName from the PodTemplate. - If the specified PriorityClass is not found, falls back to the cluster's default PriorityClass\n (i.e., the PriorityClass marked as the global default in the cluster).\n- If no valid PriorityClass is found: Sets priority=0 and preemptionPolicy=Never. - Not yet implemented.\n\nFor FederatedPriorityClass: - Not yet implemented.", Description: "PriorityClassName specifies which PriorityClass to use. Its behavior depends on PriorityClassSource:\n\nBehavior of PriorityClassName:\n\nFor KubePriorityClass: - When specified: Uses the named Kubernetes PriorityClass.\n\nFor PodPriorityClass: - Uses PriorityClassName from the PodTemplate. - Not yet implemented.\n\nFor FederatedPriorityClass: - Not yet implemented.",
Default: "",
Type: []string{"string"}, Type: []string{"string"},
Format: "", Format: "",
}, },