v1alpha1

package
v0.0.0-...-1dfa148 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the apps v1alpha1 API group +kubebuilder:object:generate=true +groupName=apps.kubedl.io

Index

Constants

View Source
const (
	KindCron = "Cron"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "apps.kubedl.io", Version: "v1alpha1"}

	// 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
)
View Source
var SchemeGroupVersion = GroupVersion

Functions

func RegisterDefaults

func RegisterDefaults(scheme *runtime.Scheme) error

RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.

func Resource

func Resource(resource string) schema.GroupResource

Resource is required by pkg/client/listers/...

Types

type ConcurrencyPolicy

type ConcurrencyPolicy string

ConcurrencyPolicy describes how the job will be handled. Only one of the following concurrent policies may be specified. If none of the following policies is specified, the default one is AllowConcurrent.

const (
	// AllowConcurrent allows CronJobs to run concurrently.
	AllowConcurrent ConcurrencyPolicy = "Allow"

	// ForbidConcurrent forbids concurrent runs, skipping next run if previous
	// hasn't finished yet.
	ForbidConcurrent ConcurrencyPolicy = "Forbid"

	// ReplaceConcurrent cancels currently running job and replaces it with a new one.
	ReplaceConcurrent ConcurrencyPolicy = "Replace"
)

type Cron

type Cron struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   CronSpec   `json:"spec,omitempty"`
	Status CronStatus `json:"status,omitempty"`
}

Cron is the Schema for the crons API

func (*Cron) DeepCopy

func (in *Cron) DeepCopy() *Cron

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cron.

func (*Cron) DeepCopyInto

func (in *Cron) DeepCopyInto(out *Cron)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Cron) DeepCopyObject

func (in *Cron) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CronHistory

type CronHistory struct {
	// Object is the reference of the historical scheduled cron job.
	Object corev1.TypedLocalObjectReference `json:"object"`
	// Status is the final status when job finished.
	Status JobConditionType `json:"status"`
	// Created is the creation timestamp of job.
	Created *metav1.Time `json:"created,omitempty"`
	// Finished is the failed or succeeded timestamp of job.
	Finished *metav1.Time `json:"finished,omitempty"`
}

func (*CronHistory) DeepCopy

func (in *CronHistory) DeepCopy() *CronHistory

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CronHistory.

func (*CronHistory) DeepCopyInto

func (in *CronHistory) DeepCopyInto(out *CronHistory)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CronList

type CronList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Cron `json:"items"`
}

CronList contains a list of Cron

func (*CronList) DeepCopy

func (in *CronList) DeepCopy() *CronList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CronList.

func (*CronList) DeepCopyInto

func (in *CronList) DeepCopyInto(out *CronList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CronList) DeepCopyObject

func (in *CronList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CronSpec

type CronSpec struct {
	// The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
	Schedule string `json:"schedule"`

	// Specifies the job that will be created when executing a CronTask.
	CronTemplate CronTemplateSpec `json:"template"`

	// Specifies how to treat concurrent executions of a Task.
	// Valid values are:
	// - "Allow" (default): allows CronJobs to run concurrently;
	// - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
	// - "Replace": cancels currently running job and replaces it with a new one
	// +optional
	ConcurrencyPolicy ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"`

	// This flag tells the controller to suspend subsequent executions, it does
	// not apply to already started executions.  Defaults to false.
	// +optional
	Suspend *bool `json:"suspend,omitempty"`

	// Deadline is the timestamp that a cron job can keep scheduling util then.
	Deadline *metav1.Time `json:"deadline,omitempty"`

	// The number of finished job history to retain.
	// This is a pointer to distinguish between explicit zero and not specified.
	// +optional
	HistoryLimit *int32 `json:"historyLimit,omitempty"`
}

CronSpec defines the desired state of Cron

func (*CronSpec) DeepCopy

func (in *CronSpec) DeepCopy() *CronSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CronSpec.

func (*CronSpec) DeepCopyInto

func (in *CronSpec) DeepCopyInto(out *CronSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CronStatus

type CronStatus struct {
	// A list of currently running jobs.
	// +optional
	Active []corev1.ObjectReference `json:"active,omitempty"`

	// History is a list of scheduled cron job with its digest records.
	// +optional
	History []CronHistory `json:"history,omitempty"`

	// Information when was the last time the job was successfully scheduled.
	// +optional
	LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"`
}

CronStatus defines the observed state of Cron

func (*CronStatus) DeepCopy

func (in *CronStatus) DeepCopy() *CronStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CronStatus.

func (*CronStatus) DeepCopyInto

func (in *CronStatus) DeepCopyInto(out *CronStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CronTemplateSpec

type CronTemplateSpec struct {
	metav1.TypeMeta `json:",inline"`

	// Workload is the specification of the desired cron job with specific types.
	// +kubebuilder:pruning:PreserveUnknownFields
	Workload *runtime.RawExtension `json:"workload,omitempty"`
}

CronTemplateSpec describes a template for launching a specific job.

func (*CronTemplateSpec) DeepCopy

func (in *CronTemplateSpec) DeepCopy() *CronTemplateSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CronTemplateSpec.

func (*CronTemplateSpec) DeepCopyInto

func (in *CronTemplateSpec) DeepCopyInto(out *CronTemplateSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobConditionType

type JobConditionType string

JobConditionType defines all kinds of types of JobStatus.

const (
	// JobCreated means the job has been accepted by the system,
	// but one or more of the pods/services has not been started.
	// This includes time before pods being scheduled and launched.
	JobCreated JobConditionType = "Created"

	// JobRunning means all sub-resources (e.g. services/pods) of this job
	// have been successfully scheduled and launched.
	// The training is running without error.
	JobRunning JobConditionType = "Running"

	// JobRestarting means one or more sub-resources (e.g. services/pods) of this job
	// reached phase failed but maybe restarted according to it's restart policy
	// which specified by user in v1.PodTemplateSpec.
	// The training is freezing/pending.
	JobRestarting JobConditionType = "Restarting"

	// JobSucceeded means all sub-resources (e.g. services/pods) of this job
	// reached phase have terminated in success.
	// The training is complete without error.
	JobSucceeded JobConditionType = "Succeeded"

	// JobFailed means one or more sub-resources (e.g. services/pods) of this job
	// reached phase failed with no restarting.
	// The training has failed its execution.
	JobFailed JobConditionType = "Failed"
)

Jump to

Keyboard shortcuts

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