apiVersion: scheduling.k8s.io/v1alpha2
import "k8s.io/api/scheduling/v1alpha2"
Workload allows for expressing scheduling constraints that should be used when managing the lifecycle of workloads from the scheduling perspective, including scheduling, preemption, eviction and other phases. Workload API enablement is toggled by the GenericWorkload feature gate.
apiVersion: scheduling.k8s.io/v1alpha2
kind: Workload
metadata (ObjectMeta)
Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (WorkloadSpec), required
Spec defines the desired behavior of a Workload.
WorkloadSpec defines the desired state of a Workload.
podGroupTemplates ([]PodGroupTemplate), required
Map: unique values on key name will be kept during a merge
PodGroupTemplates is the list of templates that make up the Workload. The maximum number of templates is 8. This field is immutable.
PodGroupTemplate represents a template for a set of pods with a scheduling policy.
podGroupTemplates.name (string), required
Name is a unique identifier for the PodGroupTemplate within the Workload. It must be a DNS label. This field is immutable.
podGroupTemplates.schedulingPolicy (PodGroupSchedulingPolicy), required
SchedulingPolicy defines the scheduling policy for this PodGroupTemplate.
PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup. Exactly one policy must be set.
podGroupTemplates.schedulingPolicy.basic (BasicSchedulingPolicy)
Basic specifies that the pods in this group should be scheduled using standard Kubernetes scheduling behavior.
BasicSchedulingPolicy indicates that standard Kubernetes scheduling behavior should be used.
podGroupTemplates.schedulingPolicy.gang (GangSchedulingPolicy)
Gang specifies that the pods in this group should be scheduled using all-or-nothing semantics.
GangSchedulingPolicy defines the parameters for gang scheduling.
podGroupTemplates.schedulingPolicy.gang.minCount (int32), required
MinCount is the minimum number of pods that must be schedulable or scheduled at the same time for the scheduler to admit the entire group. It must be a positive integer.
podGroupTemplates.disruptionMode (string)
DisruptionMode defines the mode in which a given PodGroup can be disrupted. One of Pod, PodGroup. This field is available only when the WorkloadAwarePreemption feature gate is enabled.
Possible enum values:
"Pod" means that individual pods can be disrupted or preempted independently. It doesn't depend on exact set of pods currently running in this PodGroup."PodGroup" means that the whole PodGroup needs to be disrupted or preempted together.podGroupTemplates.priority (int32)
Priority is the value of priority of pod groups created from this template. Various system components use this field to find the priority of the pod group. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. This field is available only when the WorkloadAwarePreemption feature gate is enabled.
podGroupTemplates.priorityClassName (string)
PriorityClassName indicates the priority that should be considered when scheduling a pod group created from this template. If no priority class is specified, admission control can set this to the global default priority class if it exists. Otherwise, pod groups created from this template will have the priority set to zero. This field is available only when the WorkloadAwarePreemption feature gate is enabled.
podGroupTemplates.resourceClaims ([]PodGroupResourceClaim)
Patch strategies: retainKeys, merge on key name
Map: unique values on key name will be kept during a merge
ResourceClaims defines which ResourceClaims may be shared among Pods in the group. Pods consume the devices allocated to a PodGroup's claim by defining a claim in its own Spec.ResourceClaims that matches the PodGroup's claim exactly. The claim must have the same name and refer to the same ResourceClaim or ResourceClaimTemplate.
This is an alpha-level field and requires that the DRAWorkloadResourceClaims feature gate is enabled.
This field is immutable.
*PodGroupResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the PodGroup.
It adds a name to it that uniquely identifies the ResourceClaim inside the PodGroup. Pods that need access to the ResourceClaim define a matching reference in its own Spec.ResourceClaims. The Pod's claim must match all fields of the PodGroup's claim exactly.*
podGroupTemplates.resourceClaims.name (string), required
Name uniquely identifies this resource claim inside the PodGroup. This must be a DNS_LABEL.
podGroupTemplates.resourceClaims.resourceClaimName (string)
ResourceClaimName is the name of a ResourceClaim object in the same namespace as this PodGroup. The ResourceClaim will be reserved for the PodGroup instead of its individual pods.
Exactly one of ResourceClaimName and ResourceClaimTemplateName must be set.
podGroupTemplates.resourceClaims.resourceClaimTemplateName (string)
ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this PodGroup.
The template will be used to create a new ResourceClaim, which will be bound to this PodGroup. When this PodGroup is deleted, the ResourceClaim will also be deleted. The PodGroup name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in podgroup.status.resourceClaimStatuses.
This field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.
Exactly one of ResourceClaimName and ResourceClaimTemplateName must be set.
podGroupTemplates.schedulingConstraints (PodGroupSchedulingConstraints)
SchedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate. This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled.
PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup.
podGroupTemplates.schedulingConstraints.topology ([]TopologyConstraint)
Atomic: will be replaced during a merge
Topology defines the topology constraints for the pod group. Currently only a single topology constraint can be specified. This may change in the future.
TopologyConstraint defines a topology constraint for a PodGroup.
podGroupTemplates.schedulingConstraints.topology.key (string), required
Key specifies the key of the node label representing the topology domain. All pods within the PodGroup must be colocated within the same domain instance. Different PodGroups can land on different domain instances even if they derive from the same PodGroupTemplate. Examples: "topology.kubernetes.io/rack"
controllerRef (TypedLocalObjectReference)
ControllerRef is an optional reference to the controlling object, such as a Deployment or Job. This field is intended for use by tools like CLIs to provide a link back to the original workload definition. This field is immutable.
TypedLocalObjectReference allows to reference typed object inside the same namespace.
controllerRef.kind (string), required
Kind is the type of resource being referenced. It must be a path segment name.
controllerRef.name (string), required
Name is the name of resource being referenced. It must be a path segment name.
controllerRef.apiGroup (string)
APIGroup is the group for the resource being referenced. If APIGroup is empty, the specified Kind must be in the core API group. For any other third-party types, setting APIGroup is required. It must be a DNS subdomain.
WorkloadList contains a list of Workload resources.
apiVersion: scheduling.k8s.io/v1alpha2
kind: WorkloadList
metadata (ListMeta)
Standard list metadata.
items ([]Workload), required
Items is the list of Workloads.
get read the specified WorkloadGET /apis/scheduling.k8s.io/v1alpha2/namespaces/{namespace}/workloads/{name}
name (in path): string, required
name of the Workload
namespace (in path): string, required
pretty (in query): string
200 (Workload): OK
401: Unauthorized
list list or watch objects of kind WorkloadGET /apis/scheduling.k8s.io/v1alpha2/namespaces/{namespace}/workloads
namespace (in path): string, required
allowWatchBookmarks (in query): boolean
continue (in query): string
fieldSelector (in query): string
labelSelector (in query): string
limit (in query): integer
pretty (in query): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
shardSelector (in query): string
timeoutSeconds (in query): integer
watch (in query): boolean
200 (WorkloadList): OK
401: Unauthorized
list list or watch objects of kind WorkloadGET /apis/scheduling.k8s.io/v1alpha2/workloads
allowWatchBookmarks (in query): boolean
continue (in query): string
fieldSelector (in query): string
labelSelector (in query): string
limit (in query): integer
pretty (in query): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
shardSelector (in query): string
timeoutSeconds (in query): integer
watch (in query): boolean
200 (WorkloadList): OK
401: Unauthorized
create create a WorkloadPOST /apis/scheduling.k8s.io/v1alpha2/namespaces/{namespace}/workloads
namespace (in path): string, required
body: Workload, required
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
200 (Workload): OK
201 (Workload): Created
202 (Workload): Accepted
401: Unauthorized
update replace the specified WorkloadPUT /apis/scheduling.k8s.io/v1alpha2/namespaces/{namespace}/workloads/{name}
name (in path): string, required
name of the Workload
namespace (in path): string, required
body: Workload, required
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
200 (Workload): OK
201 (Workload): Created
401: Unauthorized
patch partially update the specified WorkloadPATCH /apis/scheduling.k8s.io/v1alpha2/namespaces/{namespace}/workloads/{name}
name (in path): string, required
name of the Workload
namespace (in path): string, required
body: Patch, required
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
force (in query): boolean
pretty (in query): string
200 (Workload): OK
201 (Workload): Created
401: Unauthorized
delete delete a WorkloadDELETE /apis/scheduling.k8s.io/v1alpha2/namespaces/{namespace}/workloads/{name}
name (in path): string, required
name of the Workload
namespace (in path): string, required
body: DeleteOptions
dryRun (in query): string
gracePeriodSeconds (in query): integer
ignoreStoreReadErrorWithClusterBreakingPotential (in query): boolean
pretty (in query): string
propagationPolicy (in query): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection delete collection of WorkloadDELETE /apis/scheduling.k8s.io/v1alpha2/namespaces/{namespace}/workloads
namespace (in path): string, required
body: DeleteOptions
continue (in query): string
dryRun (in query): string
fieldSelector (in query): string
gracePeriodSeconds (in query): integer
ignoreStoreReadErrorWithClusterBreakingPotential (in query): boolean
labelSelector (in query): string
limit (in query): integer
pretty (in query): string
propagationPolicy (in query): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
shardSelector (in query): string
timeoutSeconds (in query): integer
200 (Status): OK
401: Unauthorized
This page is automatically generated.
If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.