Documentation ¶
Overview ¶
Package job provides benchmark job crd information and preriodically update
Package job manages the main logic of benchmark job.
Index ¶
- Constants
- Variables
- type BenchmarkJobOption
- func WithBackoffLimit(bo int32) BenchmarkJobOption
- func WithCompletions(com int32) BenchmarkJobOption
- func WithLabel(label map[string]string) BenchmarkJobOption
- func WithName(name string) BenchmarkJobOption
- func WithNamespace(ns string) BenchmarkJobOption
- func WithOwnerRef(refs []k8s.OwnerReference) BenchmarkJobOption
- func WithParallelism(parallelism int32) BenchmarkJobOption
- func WithRestartPolicy(rp RestartPolicy) BenchmarkJobOption
- func WithSvcAccountName(name string) BenchmarkJobOption
- func WithTTLSecondsAfterFinished(ttl int32) BenchmarkJobOption
- type BenchmarkJobTpl
- type BenchmarkJobTplOption
- type BenchmarkJobWatcher
- type ImagePullPolicy
- type Option
- type RestartPolicy
Constants ¶
const ( PullAlways ImagePullPolicy = "Always" PullNever ImagePullPolicy = "Never" PullIfNotPresent ImagePullPolicy = "PullIfNotPresent" RestartPolicyAlways RestartPolicy = "Always" RestartPolicyOnFailure RestartPolicy = "OnFailure" RestartPolicyNever RestartPolicy = "Never" )
Variables ¶
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 ¶
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 ¶
WithControllerName returns Option that sets r.name.
func WithManager ¶
WithManager returns Option that sets r.mgr.
func WithNamespaces ¶
WithNamespaces returns Option to set the namespace.
func WithOnErrorFunc ¶
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