Documentation ¶
Overview ¶
Package v1alpha2 contains API Schema definitions for the batch v1alpha2 API group +kubebuilder:object:generate=true +groupName=jobset.x-k8s.io
+k8s:openapi-gen=true
Index ¶
- Constants
- Variables
- func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition
- func Resource(resource string) schema.GroupResource
- type FailurePolicy
- type JobSet
- func (in *JobSet) DeepCopy() *JobSet
- func (in *JobSet) DeepCopyInto(out *JobSet)
- func (in *JobSet) DeepCopyObject() runtime.Object
- func (js *JobSet) Default()
- func (js *JobSet) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (js *JobSet) ValidateCreate() (admission.Warnings, error)
- func (js *JobSet) ValidateDelete() (admission.Warnings, error)
- func (js *JobSet) ValidateUpdate(old runtime.Object) (admission.Warnings, error)
- type JobSetConditionType
- type JobSetList
- type JobSetSpec
- type JobSetStatus
- type Network
- type Operator
- type ReplicatedJob
- type ReplicatedJobStatus
- type SuccessPolicy
Constants ¶
const ( JobSetNameKey string = "jobset.sigs.k8s.io/jobset-name" ReplicatedJobReplicas string = "jobset.sigs.k8s.io/replicatedjob-replicas" ReplicatedJobNameKey string = "jobset.sigs.k8s.io/replicatedjob-name" JobIndexKey string = "jobset.sigs.k8s.io/job-index" JobKey string = "jobset.sigs.k8s.io/job-key" JobNameKey string = "job-name" // TODO(#26): Migrate to the fully qualified label name. ExclusiveKey string = "alpha.jobset.sigs.k8s.io/exclusive-topology" // NodeSelectorStrategyKey is an annotation that acts as a flag, the value does not matter. // If set, the JobSet controller will automatically inject nodeSelectors for the JobSetNameKey label to // ensure exclusive job placement per topology, instead of injecting pod affinity/anti-affinites for this. // The user must add the JobSet name node label to the desired topologies separately. NodeSelectorStrategyKey string = "alpha.jobset.sigs.k8s.io/node-selector" NamespacedJobKey string = "alpha.jobset.sigs.k8s.io/namespaced-job" NoScheduleTaintKey string = "alpha.jobset.sigs.k8s.io/no-schedule" )
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "jobset.x-k8s.io", Version: "v1alpha2"} // SchemeGroupVersion is alias to GroupVersion for client-go libraries. // It is required by pkg/client/informers/externalversions/... SchemeGroupVersion = GroupVersion // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
func GetOpenAPIDefinitions ¶
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource is required by pkg/client/listers/...
Types ¶
type FailurePolicy ¶
type FailurePolicy struct { // MaxRestarts defines the limit on the number of JobSet restarts. // A restart is achieved by recreating all active child jobs. MaxRestarts int32 `json:"maxRestarts,omitempty"` }
func (*FailurePolicy) DeepCopy ¶
func (in *FailurePolicy) DeepCopy() *FailurePolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailurePolicy.
func (*FailurePolicy) DeepCopyInto ¶
func (in *FailurePolicy) DeepCopyInto(out *FailurePolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type JobSet ¶
type JobSet struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec JobSetSpec `json:"spec,omitempty"` Status JobSetStatus `json:"status,omitempty"` }
JobSet is the Schema for the jobsets API
func (*JobSet) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSet.
func (*JobSet) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*JobSet) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*JobSet) Default ¶
func (js *JobSet) Default()
Default implements webhook.Defaulter so a webhook will be registered for the type
func (*JobSet) SetupWebhookWithManager ¶
func (*JobSet) ValidateCreate ¶
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (*JobSet) ValidateDelete ¶
ValidateDelete implements webhook.Validator so a webhook will be registered for the type
type JobSetConditionType ¶
type JobSetConditionType string
const ( // JobSetComplete means the job has completed its execution. JobSetCompleted JobSetConditionType = "Completed" // JobSetFailed means the job has failed its execution. JobSetFailed JobSetConditionType = "Failed" // JobSetSuspended means the job is suspended JobSetSuspended JobSetConditionType = "Suspended" )
These are built-in conditions of a JobSet.
type JobSetList ¶
type JobSetList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []JobSet `json:"items"` }
+kubebuilder:object:root=true JobSetList contains a list of JobSet
func (*JobSetList) DeepCopy ¶
func (in *JobSetList) DeepCopy() *JobSetList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSetList.
func (*JobSetList) DeepCopyInto ¶
func (in *JobSetList) DeepCopyInto(out *JobSetList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*JobSetList) DeepCopyObject ¶
func (in *JobSetList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type JobSetSpec ¶
type JobSetSpec struct { // ReplicatedJobs is the group of jobs that will form the set. // +listType=map // +listMapKey=name ReplicatedJobs []ReplicatedJob `json:"replicatedJobs,omitempty"` // Network defines the networking options for the jobset. // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable" // +optional Network *Network `json:"network,omitempty"` // SuccessPolicy configures when to declare the JobSet as // succeeded. // The JobSet is always declared succeeded if all jobs in the set // finished with status complete. // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable" SuccessPolicy *SuccessPolicy `json:"successPolicy,omitempty"` // FailurePolicy, if set, configures when to declare the JobSet as // failed. // The JobSet is always declared failed if any job in the set // finished with status failed. // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable" FailurePolicy *FailurePolicy `json:"failurePolicy,omitempty"` // Suspend suspends all running child Jobs when set to true. Suspend *bool `json:"suspend,omitempty"` }
JobSetSpec defines the desired state of JobSet
func (*JobSetSpec) DeepCopy ¶
func (in *JobSetSpec) DeepCopy() *JobSetSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSetSpec.
func (*JobSetSpec) DeepCopyInto ¶
func (in *JobSetSpec) DeepCopyInto(out *JobSetSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type JobSetStatus ¶
type JobSetStatus struct { // +optional // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty"` // Restarts tracks the number of times the JobSet has restarted (i.e. recreated in case of RecreateAll policy). Restarts int32 `json:"restarts,omitempty"` // ReplicatedJobsStatus track the number of JobsReady for each replicatedJob. // +optional // +listType=map // +listMapKey=name ReplicatedJobsStatus []ReplicatedJobStatus `json:"replicatedJobsStatus,omitempty"` }
JobSetStatus defines the observed state of JobSet
func (*JobSetStatus) DeepCopy ¶
func (in *JobSetStatus) DeepCopy() *JobSetStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSetStatus.
func (*JobSetStatus) DeepCopyInto ¶
func (in *JobSetStatus) DeepCopyInto(out *JobSetStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Network ¶
type Network struct { // EnableDNSHostnames allows pods to be reached via their hostnames. // Pods will be reachable using the fully qualified pod hostname: // <jobSet.name>-<spec.replicatedJob.name>-<job-index>-<pod-index>.<subdomain> // +optional EnableDNSHostnames *bool `json:"enableDNSHostnames,omitempty"` // Subdomain is an explicit choice for a network subdomain name // When set, any replicated job in the set is added to this network. // Defaults to <jobSet.name> if not set. // +optional Subdomain string `json:"subdomain,omitempty"` }
func (*Network) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Network.
func (*Network) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Operator ¶
type Operator string
Operator defines the target of a SuccessPolicy or FailurePolicy.
type ReplicatedJob ¶
type ReplicatedJob struct { // Name is the name of the entry and will be used as a suffix // for the Job name. Name string `json:"name"` // Template defines the template of the Job that will be created. Template batchv1.JobTemplateSpec `json:"template"` // Replicas is the number of jobs that will be created from this ReplicatedJob's template. // Jobs names will be in the format: <jobSet.name>-<spec.replicatedJob.name>-<job-index> // +kubebuilder:default=1 Replicas int32 `json:"replicas,omitempty"` }
func (*ReplicatedJob) DeepCopy ¶
func (in *ReplicatedJob) DeepCopy() *ReplicatedJob
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicatedJob.
func (*ReplicatedJob) DeepCopyInto ¶
func (in *ReplicatedJob) DeepCopyInto(out *ReplicatedJob)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ReplicatedJobStatus ¶
type ReplicatedJobStatus struct { Name string `json:"name"` Ready int32 `json:"ready"` Succeeded int32 `json:"succeeded"` Failed int32 `json:"failed"` Active int32 `json:"active"` }
ReplicatedJobStatus defines the observed ReplicatedJobs Readiness.
func (*ReplicatedJobStatus) DeepCopy ¶
func (in *ReplicatedJobStatus) DeepCopy() *ReplicatedJobStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicatedJobStatus.
func (*ReplicatedJobStatus) DeepCopyInto ¶
func (in *ReplicatedJobStatus) DeepCopyInto(out *ReplicatedJobStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SuccessPolicy ¶
type SuccessPolicy struct { // Operator determines either All or Any of the selected jobs should succeed to consider the JobSet successful // +kubebuilder:validation:Enum=All;Any Operator Operator `json:"operator"` // TargetReplicatedJobs are the names of the replicated jobs the operator will apply to. // A null or empty list will apply to all replicatedJobs. // +optional // +listType=atomic TargetReplicatedJobs []string `json:"targetReplicatedJobs,omitempty"` }
func (*SuccessPolicy) DeepCopy ¶
func (in *SuccessPolicy) DeepCopy() *SuccessPolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SuccessPolicy.
func (*SuccessPolicy) DeepCopyInto ¶
func (in *SuccessPolicy) DeepCopyInto(out *SuccessPolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.