v1alpha1

package
v0.0.0-...-e91ad15 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 7 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"}

	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 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 takes an unqualified resource and returns a Group-qualified GroupResource.

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 {
	// UID of the referent.
	UID types.UID `json:"uid"`
	// Object is the reference of the historical scheduled cron job.
	Object corev1.TypedLocalObjectReference `json:"object"`
	// Status is the final status when job finished.
	Status v1.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 ParaSet

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

	Spec   ParaSetSpec   `json:"spec,omitempty"`
	Status ParaSetStatus `json:"status,omitempty"`
}

ParaSet is the Schema for the parasets API

func (*ParaSet) DeepCopy

func (in *ParaSet) DeepCopy() *ParaSet

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

func (*ParaSet) DeepCopyInto

func (in *ParaSet) DeepCopyInto(out *ParaSet)

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

func (*ParaSet) DeepCopyObject

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

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

type ParaSetList

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

ParaSetList contains a list of ParaSet

func (*ParaSetList) DeepCopy

func (in *ParaSetList) DeepCopy() *ParaSetList

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

func (*ParaSetList) DeepCopyInto

func (in *ParaSetList) DeepCopyInto(out *ParaSetList)

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

func (*ParaSetList) DeepCopyObject

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

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

type ParaSetSpec

type ParaSetSpec struct {

	//expression
	Schedules []Schedule `json:"schedules"`

	// A label query over pods that are managed by the para set.
	// Must match in order to be controlled.
	// It must match the pod template's labels.
	Selector *metav1.LabelSelector `json:"selector"`

	// An object that describes the pod that will be created.
	// The paraSet will create exactly one copy of this pod on every node
	// that matches the template's node selector (or on every node if no node
	// selector is specified).
	Template v1.PodTemplateSpec `json:"template"`
}

ParaSetSpec defines the desired state of ParaSet

func (*ParaSetSpec) DeepCopy

func (in *ParaSetSpec) DeepCopy() *ParaSetSpec

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

func (*ParaSetSpec) DeepCopyInto

func (in *ParaSetSpec) DeepCopyInto(out *ParaSetSpec)

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

type ParaSetStatus

type ParaSetStatus struct {

	// The number of nodes that are running at least 1
	// paraset pod and are supposed to run the para pod.
	NumberNodesScheduled int32 `json:"numberNodesScheduled"`

	// The total number of nodes that should be running the para
	// pod (including nodes correctly running the para pod).
	NumberNodesDesiredScheduled int32 `json:"numberNodesDesiredScheduled"`

	// The number of pods are running and available.
	NumberPodsAvailable int32 `json:"numberPodsAvailable"`

	// The total number of pods that should be running and
	// available (including nodes correctly running the para pod).
	NumberPodsDesiredAvailable int32 `json:"numberPodsDesiredAvailable"`
}

ParaSetStatus defines the observed state of ParaSet

func (*ParaSetStatus) DeepCopy

func (in *ParaSetStatus) DeepCopy() *ParaSetStatus

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

func (*ParaSetStatus) DeepCopyInto

func (in *ParaSetStatus) DeepCopyInto(out *ParaSetStatus)

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

type ResourcesRange

type ResourcesRange struct {
	// The container name in pod spec
	ContainerName string `json:"containerName"`

	// The minimum required resources for the container
	Min v1.ResourceRequirements `json:"min"`

	// Maximum resources that can be applied for by the container
	Max v1.ResourceRequirements `json:"max"`
}

ResourcesRange the container resources range

func (*ResourcesRange) DeepCopy

func (in *ResourcesRange) DeepCopy() *ResourcesRange

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

func (*ResourcesRange) DeepCopyInto

func (in *ResourcesRange) DeepCopyInto(out *ResourcesRange)

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

type Schedule

type Schedule struct {
	// The crontab expression e.g. "* * * * ?"
	/*
	   	A cron expression represents a set of times, using 5 space-separated fields.

	   	Field name   | Mandatory? | Allowed values  | Allowed special characters
	   	----------   | ---------- | --------------  | --------------------------
	   	Minutes      | Yes        | 0-59            | * / , -
	   	Hours        | Yes        | 0-23            | * / , -
	   	Day of month | Yes        | 1-31            | * / , - ?
	   	Month        | Yes        | 1-12 or JAN-DEC | * / , -
	   	Day of week  | Yes        | 0-6 or SUN-SAT  | * / , - ?

	   Month and Day-of-week field values are case insensitive.  "SUN", "Sun", and
	   "sun" are equally accepted.
	*/
	Cron string `json:"cron,omitempty"`

	// The max number of pods that belongs to this paraset in one node.
	MaxReplicaPerNode *int32 `json:"maxReplicaPerNode,omitempty"`

	// The resources range for each container
	ResourcesRanges []ResourcesRange `json:"resourcesRanges"`
}

Schedule the Schedule of paraset

func (*Schedule) DeepCopy

func (in *Schedule) DeepCopy() *Schedule

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

func (*Schedule) DeepCopyInto

func (in *Schedule) DeepCopyInto(out *Schedule)

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

Jump to

Keyboard shortcuts

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