config

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Replicas number of replicas to create of the given object
	Replica = "replica"
	// Iteration how many times to execute the workload
	Iteration = "iteration"
	// Namespace prefix to be create to create objects
	Namespace = "namespace"
	// WorkloadLabel identifies all namespaces and objects created within the workload
	// It is mostly used to cleanup
	WorkloadLabel = "kubevirt-load-generator-workload"
)

Object template global input variable name

View Source
const RequestTimeout = 15 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration struct {
	time.Duration
}

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type GlobalConfig

type GlobalConfig struct {
	// Client defines global configuration parameters
	Client kubecli.KubevirtClient `yaml:"kubevirtClient,omitempty" json:"kubevirtClient,omitempty"`
	// QPS is the max number of queries per second to configure the kubernetes client-go
	QPS float64 `yaml:"qps" json:"qps"`
	// Burst is the maximum burst for throttle to configure the kubernetes client-go
	Burst int `yaml:"burst" json:"burst"`
}

GlobalConfig defined the kubernetes client-go configuration

type ObjectSpec

type ObjectSpec struct {
	// TemplateFile relative path to a valid YAML definition of a kubevirt resource
	TemplateFile string `yaml:"templateFile" json:"templateFile,omitempty"`
	// ObjectTemplate contains the object template that must be fill with global and arbitrary user-defined input variables
	ObjectTemplate []byte `yaml:"objectTemplate" json:"objectTemplate,omitempty"`
	// Replicas number of replicas to create of the given object
	Replicas int `yaml:"replicas" json:"replicas,omitempty"`
	// InputVars contains a map of arbitrary user-define input variables
	// that can be introduced in the template by users
	InputVars map[string]interface{} `yaml:"inputVars" json:"inputVars,omitempty"`
}

ObjectSpec defines an object spec that the load generator will create (e.g. VMs, VMIs, etc)

type TestConfig

type TestConfig struct {
	// Global defines global configuration parameters
	Global GlobalConfig `yaml:"globalConfig" json:"globalConfig"`
	// Workloads contains a set of jobs that define how the load generator will create objects (e.g. VMs, VMIs, etc)
	Workloads []Workload `yaml:"workloads" json:"workloads"`
}

TestConfig is the test configuration specification

func NewConfig

func NewConfig() *TestConfig

NewConfig returns a new config object

func (*TestConfig) LoadKubeClient

func (t *TestConfig) LoadKubeClient()

LoadKubeClient configured the kubernetes client-go

func (*TestConfig) LoadObjTemplate

func (t *TestConfig) LoadObjTemplate()

LoadObjTemplate reads an YAML file with the object template for each object defined in the workload's jobs

func (*TestConfig) LoadWorkloadConfig

func (t *TestConfig) LoadWorkloadConfig(testConfigPath string)

LoadWorkloadConfig reads the test configuration file

type Workload

type Workload struct {
	// UUID workload id
	UUID string `yaml:"uuid" json:"uuid,omitempty"`
	// Name workload name
	Name string `yaml:"name" json:"name"`
	// Objects list of object spec
	Objects []*ObjectSpec `yaml:"objects" json:"objects"`
	// NamespacedIterations create a namespace per workload iteration
	NamespacedIterations bool `yaml:"namespacedIterations" json:"namespacedIterations,omitempty"`
	// IterationCount how many times to execute the workload
	IterationCount int `yaml:"iterationCount" json:"iterationCount"`
	// IterationInterval how much time to wait between each workload iteration
	IterationInterval Duration `yaml:"iterationInterval" json:"iterationInterval,omitempty"`
	// IterationCleanup clean up old tests, e.g., namespaces, nodes, configurations, before moving forward to the next iteration
	IterationCleanup bool `yaml:"iterationCleanup" json:"iterationCleanup,omitempty"`
	// IterationCreationWait wait for all objects to be running before moving forward to the next iteration
	IterationCreationWait bool `yaml:"iterationCreationWait" json:"iterationCreationWait,omitempty"`
	// IterationDeletionWait wait for objects to be deleted in each iteration
	IterationDeletionWait bool `yaml:"iterationDeletionWait" json:"iterationDeletionWait,omitempty"`
	// MaxWaitTimeout maximum wait period for all iterations
	MaxWaitTimeout Duration `yaml:"maxWaitTimeout" json:"maxWaitTimeout,omitempty"`
	// QPS is the max number of queries per second to control the job creation rate
	QPS float64 `yaml:"qps" json:"qps"`
	// Burst is the maximum burst for throttle to control the job creation rate
	Burst int `yaml:"burst" json:"burst"`
	// WaitWhenFinished delays the termination of the workload
	WaitWhenFinished Duration `yaml:"waitWhenFinished" json:"waitWhenFinished,omitempty"`
}

Workload defines a load generator workload to create a list of objects

Jump to

Keyboard shortcuts

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