controllers

package
v0.0.0-...-bc88e69 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FailedDeleteJobReason     = "FailedDeleteJob"
	SuccessfulDeleteJobReason = "SuccessfulDeleteJob"

	// ElasticJobCreatedReason is added in a job when it is created.
	ElasticJobCreatedReason    = "ElasticJobCreated"
	ElasticJobSucceededReason  = "ElasticJobSucceeded"
	ElasticJobRunningReason    = "ElasticJobRunning"
	ElasticJobFailedReason     = "ElasticJobFailed"
	ElasticJobRestartingReason = "ElasticJobRestarting"
)

Reasons for job events.

Variables

This section is empty.

Functions

func SetClusterSpecForPod

func SetClusterSpecForPod(job interface{}, podTemplate *corev1.PodTemplateSpec) error

Set pod environment set for ElasticJob

Types

type ElasticJobReconciler

type ElasticJobReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

ElasticJobReconciler reconciles a ElasticJob object

func (*ElasticJobReconciler) ControllerName

func (r *ElasticJobReconciler) ControllerName() string

func (*ElasticJobReconciler) CreatePod

func (r *ElasticJobReconciler) CreatePod(job interface{}, pod *corev1.Pod) error

CreatePod creates the pod of the job

func (*ElasticJobReconciler) CreateService

func (r *ElasticJobReconciler) CreateService(job interface{}, service *corev1.Service) error

CreateService creates the service

func (*ElasticJobReconciler) DeleteJob

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

DeleteJob deletes the job

func (*ElasticJobReconciler) DeletePod

func (r *ElasticJobReconciler) DeletePod(job interface{}, pod *corev1.Pod) error

DeletePod deletes the pod of the job

func (*ElasticJobReconciler) DeleteService

func (r *ElasticJobReconciler) DeleteService(job interface{}, name string, namespace string) error

DeleteService deletes the service

func (*ElasticJobReconciler) GetAPIGroupVersion

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

func (*ElasticJobReconciler) GetAPIGroupVersionKind

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

func (*ElasticJobReconciler) GetDefaultContainerName

func (r *ElasticJobReconciler) GetDefaultContainerName() string

func (*ElasticJobReconciler) GetDefaultContainerPortName

func (r *ElasticJobReconciler) GetDefaultContainerPortName() string

func (*ElasticJobReconciler) GetDefaultContainerPortNumber

func (r *ElasticJobReconciler) GetDefaultContainerPortNumber() int32

func (*ElasticJobReconciler) GetGroupNameLabelValue

func (r *ElasticJobReconciler) GetGroupNameLabelValue() string

func (*ElasticJobReconciler) GetJobFromAPIClient

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

GetJobFromAPIClient returns the Job from API server

func (*ElasticJobReconciler) GetJobFromInformerCache

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

GetJobFromInformerCache returns the Job from Informer Cache

func (*ElasticJobReconciler) GetJobRoleKey

func (r *ElasticJobReconciler) GetJobRoleKey() string

func (*ElasticJobReconciler) GetPodsForJob

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

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

func (*ElasticJobReconciler) GetServicesForJob

func (r *ElasticJobReconciler) 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 (*ElasticJobReconciler) IsMasterRole

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

func (*ElasticJobReconciler) Reconcile

func (r *ElasticJobReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

func (*ElasticJobReconciler) SetClusterSpec

func (r *ElasticJobReconciler) SetClusterSpec(job interface{}, podTemplate *corev1.PodTemplateSpec, rtype, index string) error

SetClusterSpec sets the cluster spec for the pod

func (*ElasticJobReconciler) SetupWithManager

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

func (*ElasticJobReconciler) UpdateJobStatus

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

UpdateJobStatus updates the job status and job conditions

func (*ElasticJobReconciler) UpdateJobStatusInApiServer

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

UpdateJobStatusInApiServer updates the job status in to cluster.

Jump to

Keyboard shortcuts

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