elasticbatch

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package controller provides a Kubernetes controller for a ElasticBatchJob resource.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnOwnerDeleteAndDeletionExpectationFunc

func OnOwnerDeleteAndDeletionExpectationFunc(jc job_controller.JobController) func(e event.DeleteEvent) bool

Types

type ElasticBatchConfig

type ElasticBatchConfig struct {
	Task        TaskSpec `json:"task"`
	Environment string   `json:"environment"`
}

type ElasticBatchJobReconciler

type ElasticBatchJobReconciler struct {
	client.Client

	utilruntime.EmptyScaleImpl
	// contains filtered or unexported fields
}

ElasticBatchJobReconciler reconciles a ElasticBatchJob object

func (*ElasticBatchJobReconciler) ControllerName

func (r *ElasticBatchJobReconciler) ControllerName() string

ControllerName returns the Controller name

func (*ElasticBatchJobReconciler) DeleteJob

func (r *ElasticBatchJobReconciler) DeleteJob(job interface{}) error

DeleteJob deletes the job

func (*ElasticBatchJobReconciler) GetAPIGroupVersion

func (r *ElasticBatchJobReconciler) GetAPIGroupVersion() schema.GroupVersion

GetAPIGroupVersion returns the GroupVersion of the API

func (*ElasticBatchJobReconciler) GetAPIGroupVersionKind

func (r *ElasticBatchJobReconciler) GetAPIGroupVersionKind() schema.GroupVersionKind

GetAPIGroupVersionKind returns the GroupVersionKind of the API

func (*ElasticBatchJobReconciler) GetDefaultContainerName

func (r *ElasticBatchJobReconciler) GetDefaultContainerName() string

GetDefaultContainerName returns the default container name in pod

func (*ElasticBatchJobReconciler) GetDefaultContainerPortName

func (r *ElasticBatchJobReconciler) GetDefaultContainerPortName() string

GetDefaultContainerPortName Get the default container port name

func (*ElasticBatchJobReconciler) GetDefaultContainerPortNumber

func (r *ElasticBatchJobReconciler) GetDefaultContainerPortNumber() int32

GetDefaultContainerPortNumber get the default container port number

func (*ElasticBatchJobReconciler) GetGroupNameLabelValue

func (r *ElasticBatchJobReconciler) GetGroupNameLabelValue() string

GetGroupNameLabelValue returns the Group Name(value) in the labels of the job

func (*ElasticBatchJobReconciler) GetJobFromAPIClient

func (r *ElasticBatchJobReconciler) GetJobFromAPIClient(namespace, name string) (metav1.Object, error)

GetJobFromAPIClient returns the Job from API server

func (*ElasticBatchJobReconciler) GetJobFromInformerCache

func (r *ElasticBatchJobReconciler) GetJobFromInformerCache(namespace, name string) (metav1.Object, error)

GetJobFromInformerCache returns the Job from Informer Cache

func (*ElasticBatchJobReconciler) GetNodeForModelOutput

func (r *ElasticBatchJobReconciler) GetNodeForModelOutput(pods []*corev1.Pod) (nodeName string)

func (*ElasticBatchJobReconciler) GetPodsForJob

func (r *ElasticBatchJobReconciler) GetPodsForJob(obj interface{}) ([]*corev1.Pod, error)

GetPodsForJob returns the set of pods that this job should manage.

func (*ElasticBatchJobReconciler) GetReconcileOrders

func (r *ElasticBatchJobReconciler) GetReconcileOrders() []v1.ReplicaType

Get replicas reconcile orders so that replica type with higher priority can be created earlier.

func (*ElasticBatchJobReconciler) GetServicesForJob

func (r *ElasticBatchJobReconciler) GetServicesForJob(obj interface{}) ([]*corev1.Service, error)

GetServicesForJob returns the services managed by the job. This can be achieved by selecting services using label key "job-name" i.e. all services created by the job will come with label "job-name" = <this_job_name>

func (*ElasticBatchJobReconciler) IsMasterRole

func (r *ElasticBatchJobReconciler) IsMasterRole(replicas map[v1.ReplicaType]*v1.ReplicaSpec, rtype v1.ReplicaType, index int) bool

IsMasterRole returns if this replica type with index specified is a master role. MasterRole pod will have "job-role=master" set in its label

func (*ElasticBatchJobReconciler) Reconcile

func (*ElasticBatchJobReconciler) SetClusterSpec

func (r *ElasticBatchJobReconciler) SetClusterSpec(ctx context.Context, job interface{}, podTemplateSpec *corev1.PodTemplateSpec, rt, index string) error

SetClusterSpec generates and sets ElASTICBATCH_CONFIG for the given podTemplateSpec.

func (*ElasticBatchJobReconciler) SetupWithManager

func (r *ElasticBatchJobReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*ElasticBatchJobReconciler) UpdateJobStatus

func (r *ElasticBatchJobReconciler) UpdateJobStatus(job interface{}, replicas map[v1.ReplicaType]*v1.ReplicaSpec, jobStatus *v1.JobStatus, restart bool) error

UpdateJobStatus updates the job status and job conditions

func (*ElasticBatchJobReconciler) UpdateJobStatusInApiServer

func (r *ElasticBatchJobReconciler) UpdateJobStatusInApiServer(job interface{}, jobStatus *v1.JobStatus) error

UpdateJobStatusInApiServer updates the job status in API server

type TaskSpec

type TaskSpec struct {
	Type  string `json:"type"`
	Index int    `json:"index"`
}

TaskSpec is the specification for a task (PS or worker) of the ElasticBatchJob.

Jump to

Keyboard shortcuts

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