job

package
v1.7.12 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package job provides benchmark job crd information and preriodically update

Package job manages the main logic of benchmark job.

Index

Constants

View Source
const (
	PullAlways       ImagePullPolicy = "Always"
	PullNever        ImagePullPolicy = "Never"
	PullIfNotPresent ImagePullPolicy = "PullIfNotPresent"

	RestartPolicyAlways    RestartPolicy = "Always"
	RestartPolicyOnFailure RestartPolicy = "OnFailure"
	RestartPolicyNever     RestartPolicy = "Never"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "vald.vdaas.org", Version: "v1"}
	// 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

This section is empty.

Types

type BenchmarkJobOption

type BenchmarkJobOption func(b *jobs.Job) error

BenchmarkJobOption represents the option for create benchmark job template.

func WithBackoffLimit

func WithBackoffLimit(bo int32) BenchmarkJobOption

WithBackoffLimit sets the job backoff limit for benchmark job.

func WithCompletions

func WithCompletions(com int32) BenchmarkJobOption

WithCompletions sets the job completion.

func WithLabel

func WithLabel(label map[string]string) BenchmarkJobOption

WithLabel sets the label to the job resource.

func WithName

func WithName(name string) BenchmarkJobOption

WithName sets the job name of benchmark job.

func WithNamespace

func WithNamespace(ns string) BenchmarkJobOption

WithNamespace specify namespace where job will execute.

func WithOwnerRef

func WithOwnerRef(refs []k8s.OwnerReference) BenchmarkJobOption

WithOwnerRef sets the OwnerReference to the job resource.

func WithParallelism

func WithParallelism(parallelism int32) BenchmarkJobOption

WithParallelism sets the job parallelism.

func WithRestartPolicy

func WithRestartPolicy(rp RestartPolicy) BenchmarkJobOption

WithRestartPolicy sets the job restart policy for benchmark job.

func WithSvcAccountName

func WithSvcAccountName(name string) BenchmarkJobOption

WithSvcAccountName sets the service account name for benchmark job.

func WithTTLSecondsAfterFinished

func WithTTLSecondsAfterFinished(ttl int32) BenchmarkJobOption

WithTTLSecondsAfterFinished sets the TTLSecondsAfterFinished to the job template.

type BenchmarkJobTpl

type BenchmarkJobTpl interface {
	CreateJobTpl(opts ...BenchmarkJobOption) (jobs.Job, error)
}

func NewBenchmarkJob

func NewBenchmarkJob(opts ...BenchmarkJobTplOption) (BenchmarkJobTpl, error)

type BenchmarkJobTplOption

type BenchmarkJobTplOption func(b *benchmarkJobTpl) error

func WithContainerImage

func WithContainerImage(name string) BenchmarkJobTplOption

WithContainerImage sets the docker image path for benchmark job.

func WithContainerName

func WithContainerName(name string) BenchmarkJobTplOption

WithContainerName sets the docker container name of benchmark job.

func WithImagePullPolicy

func WithImagePullPolicy(p ImagePullPolicy) BenchmarkJobTplOption

WithImagePullPolicy sets the docker image pull policy for benchmark job.

type BenchmarkJobWatcher

type BenchmarkJobWatcher k8s.ResourceController

func New

func New(opts ...Option) (BenchmarkJobWatcher, error)

type ImagePullPolicy

type ImagePullPolicy corev1.PullPolicy

type Option

type Option func(*reconciler) error

func WithControllerName

func WithControllerName(name string) Option

WithControllerName returns Option that sets r.name.

func WithManager

func WithManager(mgr manager.Manager) Option

WithManager returns Option that sets r.mgr.

func WithNamespaces

func WithNamespaces(nss ...string) Option

WithNamespaces returns Option to set the namespace.

func WithOnErrorFunc

func WithOnErrorFunc(f func(err error)) Option

WithOnErrorFunc returns Option that sets r.onError.

func WithOnReconcileFunc

func WithOnReconcileFunc(f func(ctx context.Context, jobList map[string]v1.ValdBenchmarkJob)) Option

WithOnReconcileFunc returns Option that sets r.onReconcile.

type RestartPolicy

type RestartPolicy corev1.RestartPolicy

Jump to

Keyboard shortcuts

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