job

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobMinParallelismAnnotation              = "kueue.x-k8s.io/job-min-parallelism"
	JobCompletionsEqualParallelismAnnotation = "kueue.x-k8s.io/job-completions-equal-parallelism"
)

Variables

View Source
var (
	FrameworkName = "batch/job"
)
View Source
var (
	ManagedLabels = []string{legacyJobNameLabel, legacyControllerUIDLabel, batchv1.JobNameLabel, batchv1.ControllerUidLabel}
)

The following labels are managed internally by batch/job controller, we should not propagate them to the workload.

View Source
var NewReconciler = jobframework.NewGenericReconcilerFactory(
	func() jobframework.GenericJob {
		return &Job{}
	}, func(b *builder.Builder, c client.Client) *builder.Builder {
		return b.Watches(&kueue.Workload{}, &parentWorkloadHandler{client: c})
	},
)

Functions

func GetWorkloadNameForJob

func GetWorkloadNameForJob(jobName string, jobUID types.UID) string

func SetupIndexes

func SetupIndexes(ctx context.Context, fieldIndexer client.FieldIndexer) error

func SetupWebhook

func SetupWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error

SetupWebhook configures the webhook for batchJob.

Types

type Job

type Job batchv1.Job

func (*Job) Finished

func (j *Job) Finished() (message string, success, finished bool)

func (*Job) GVK added in v0.5.0

func (j *Job) GVK() schema.GroupVersionKind

func (*Job) IsActive

func (j *Job) IsActive() bool

func (*Job) IsSuspended

func (j *Job) IsSuspended() bool

func (*Job) Object

func (j *Job) Object() client.Object

func (*Job) PodSets

func (j *Job) PodSets() []kueue.PodSet

func (*Job) PodsReady

func (j *Job) PodsReady() bool

func (*Job) ReclaimablePods added in v0.4.0

func (j *Job) ReclaimablePods() ([]kueue.ReclaimablePod, error)

func (*Job) RestorePodSetsInfo added in v0.4.0

func (j *Job) RestorePodSetsInfo(podSetsInfo []podset.PodSetInfo) bool

func (*Job) RunWithPodSetsInfo added in v0.4.0

func (j *Job) RunWithPodSetsInfo(podSetsInfo []podset.PodSetInfo) error

func (*Job) Stop added in v0.4.0

func (j *Job) Stop(ctx context.Context, c client.Client, podSetsInfo []podset.PodSetInfo, _ jobframework.StopReason, eventMsg string) (bool, error)

func (*Job) Suspend

func (j *Job) Suspend()

type JobWebhook

type JobWebhook struct {
	// contains filtered or unexported fields
}

func (*JobWebhook) Default

func (w *JobWebhook) Default(ctx context.Context, obj runtime.Object) error

Default implements webhook.CustomDefaulter so a webhook will be registered for the type

func (*JobWebhook) ValidateCreate

func (w *JobWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error)

ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type

func (*JobWebhook) ValidateDelete

func (w *JobWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error)

ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type

func (*JobWebhook) ValidateUpdate

func (w *JobWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL