job

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromCells added in v1.5.0

func FromCells(cells []dataselect.DataCell) []batch.Job

func GetJobEvents

func GetJobEvents(client client.Interface, dsQuery *dataselect.DataSelectQuery, namespace, name string) (
	*common.EventList, error)

GetJobEvents gets events associated to job.

func GetJobPods added in v1.1.1

func GetJobPods(client k8sClient.Interface, metricClient metricapi.MetricClient,
	dsQuery *dataselect.DataSelectQuery, namespace string, jobName string) (*pod.PodList, error)

GetJobPods return list of pods targeting job.

func ToCells added in v1.5.0

func ToCells(std []batch.Job) []dataselect.DataCell

Types

type Job

type Job struct {
	ObjectMeta api.ObjectMeta `json:"objectMeta"`
	TypeMeta   api.TypeMeta   `json:"typeMeta"`

	// Aggregate information about pods belonging to this Job.
	Pods common.PodInfo `json:"pods"`

	// Container images of the Job.
	ContainerImages []string `json:"containerImages"`

	// Init Container images of the Job.
	InitContainerImages []string `json:"initContainerImages"`

	// number of parallel jobs defined.
	Parallelism *int32 `json:"parallelism"`

	// JobStatus contains inferred job status based on job conditions
	JobStatus JobStatus `json:"jobStatus"`
}

Job is a presentation layer view of Kubernetes Job resource. This means it is Job plus additional augmented data we can get from other sources

type JobCell added in v1.4.0

type JobCell batch.Job

func (JobCell) GetProperty added in v1.4.0

func (self JobCell) GetProperty(name dataselect.PropertyName) dataselect.ComparableValue

func (JobCell) GetResourceSelector added in v1.4.0

func (self JobCell) GetResourceSelector() *metricapi.ResourceSelector

type JobDetail

type JobDetail struct {
	ObjectMeta api.ObjectMeta `json:"objectMeta"`
	TypeMeta   api.TypeMeta   `json:"typeMeta"`

	// Aggregate information about pods belonging to this Job.
	PodInfo common.PodInfo `json:"podInfo"`

	// Detailed information about Pods belonging to this Job.
	PodList pod.PodList `json:"podList"`

	// Container images of the Job.
	ContainerImages []string `json:"containerImages"`

	// Init container images of the Job.
	InitContainerImages []string `json:"initContainerImages"`

	// List of events related to this Job.
	EventList common.EventList `json:"eventList"`

	// Parallelism specifies the maximum desired number of pods the job should run at any given time.
	Parallelism *int32 `json:"parallelism"`

	// Completions specifies the desired number of successfully finished pods the job should be run with.
	Completions *int32 `json:"completions"`

	// List of non-critical errors, that occurred during resource retrieval.
	Errors []error `json:"errors"`
}

JobDetail is a presentation layer view of Kubernetes Job resource. This means it is Job plus additional augmented data we can get from other sources (like services that target the same pods).

func GetJobDetail

func GetJobDetail(client k8sClient.Interface, metricClient metricapi.MetricClient, namespace, name string) (
	*JobDetail, error)

GetJobDetail gets job details.

type JobList

type JobList struct {
	ListMeta          api.ListMeta       `json:"listMeta"`
	CumulativeMetrics []metricapi.Metric `json:"cumulativeMetrics"`

	// Basic information about resources status on the list.
	Status common.ResourceStatus `json:"status"`

	// Unordered list of Jobs.
	Jobs []Job `json:"jobs"`

	// List of non-critical errors, that occurred during resource retrieval.
	Errors []error `json:"errors"`
}

JobList contains a list of Jobs in the cluster.

func GetJobList

func GetJobList(client client.Interface, nsQuery *common.NamespaceQuery,
	dsQuery *dataselect.DataSelectQuery, metricClient metricapi.MetricClient) (*JobList, error)

GetJobList returns a list of all Jobs in the cluster.

func GetJobListFromChannels

func GetJobListFromChannels(channels *common.ResourceChannels, dsQuery *dataselect.DataSelectQuery,
	metricClient metricapi.MetricClient) (*JobList, error)

GetJobListFromChannels returns a list of all Jobs in the cluster reading required resource list once from the channels.

func ToJobList

func ToJobList(jobs []batch.Job, pods []v1.Pod, events []v1.Event, nonCriticalErrors []error,
	dsQuery *dataselect.DataSelectQuery, metricClient metricapi.MetricClient) *JobList

type JobStatus added in v1.10.0

type JobStatus struct {
	// Short, machine understandable job status code.
	Status JobStatusType `json:"status"`
	// A human-readable description of the status of related job.
	Message string `json:"message"`
}

type JobStatusType added in v1.10.0

type JobStatusType string
const (
	// JobRunning means the job is still running.
	JobStatusRunning JobStatusType = "Running"
	// JobComplete means the job has completed its execution.
	JobStatusComplete JobStatusType = "Complete"
	// JobFailed means the job has failed its execution.
	JobStatusFailed JobStatusType = "Failed"
)

Jump to

Keyboard shortcuts

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