Documentation ¶
Index ¶
- Variables
- func NewFileConfigMap(cfgName, filename string, content []byte) (*coreV1.ConfigMap, error)
- func NewFileVolumeAndMount(name, cfg, filename string) (coreV1.Volume, coreV1.VolumeMount)
- type Backend
- func (b *Backend) GetEnvConfig() interface{}
- func (b *Backend) NewJob(loadTest loadTestV1.LoadTest, volumes []coreV1.Volume, ...) *batchV1.Job
- func (b *Backend) SetDefaults()
- func (b *Backend) SetKubeClientSet(kubeClientSet kubernetes.Interface)
- func (b *Backend) SetLogger(logger *zap.Logger)
- func (b *Backend) SetPodAnnotations(podAnnotations map[string]string)
- func (b *Backend) SetPodNodeSelector(nodeselector map[string]string)
- func (b *Backend) SetPodTolerations(tolerations []coreV1.Toleration)
- func (b *Backend) Sync(ctx context.Context, loadTest loadTestV1.LoadTest, reportURL string) error
- func (b *Backend) SyncStatus(ctx context.Context, _ loadTestV1.LoadTest, ...) error
- func (b *Backend) TransformLoadTestSpec(spec *loadTestV1.LoadTestSpec) error
- func (*Backend) Type() loadTestV1.LoadTestType
- type Config
Constants ¶
This section is empty.
Variables ¶
var ( // ErrRequireMinOneDistributedPod Backend spec requires 1 or more DistributedPods ErrRequireMinOneDistributedPod = errors.New("LoadTest must specify 1 or more DistributedPods") // ErrRequireTestFile the TestFile filed is required to not be an empty string ErrRequireTestFile = errors.New("LoadTest TestFile is required") )
Functions ¶
func NewFileConfigMap ¶
NewFileConfigMap creates a configmap for the provided file information
func NewFileVolumeAndMount ¶
func NewFileVolumeAndMount(name, cfg, filename string) (coreV1.Volume, coreV1.VolumeMount)
NewFileVolumeAndMount creates a new volume and volume mount for a configmap file
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is the k6 implementation of backend interface
func (*Backend) GetEnvConfig ¶
func (b *Backend) GetEnvConfig() interface{}
GetEnvConfig must return config struct pointer
func (*Backend) NewJob ¶
func (b *Backend) NewJob( loadTest loadTestV1.LoadTest, volumes []coreV1.Volume, mounts []coreV1.VolumeMount, envvarSecret *coreV1.Secret, reportURL string, index int32, ) *batchV1.Job
NewJob creates a new job that runs k6
func (*Backend) SetKubeClientSet ¶
func (b *Backend) SetKubeClientSet(kubeClientSet kubernetes.Interface)
SetKubeClientSet receives a copy of kubeClientSet
func (*Backend) SetPodAnnotations ¶
SetPodAnnotations receives a copy of pod annotations
func (*Backend) SetPodNodeSelector ¶
SetPodNodeSelector receives a copy of pod node selectors
func (*Backend) SetPodTolerations ¶
func (b *Backend) SetPodTolerations(tolerations []coreV1.Toleration)
SetPodTolerations receives a copy of pod tolerations
func (*Backend) Sync ¶
Sync checks if k6 kubernetes resources have been created, create them if they haven't
func (*Backend) SyncStatus ¶
func (b *Backend) SyncStatus(ctx context.Context, _ loadTestV1.LoadTest, loadTestStatus *loadTestV1.LoadTestStatus) error
SyncStatus checks k6 resources and updates the status of the LoadTest resource
func (*Backend) TransformLoadTestSpec ¶
func (b *Backend) TransformLoadTestSpec(spec *loadTestV1.LoadTestSpec) error
TransformLoadTestSpec use given spec to validate and return a new one or error
func (*Backend) Type ¶
func (*Backend) Type() loadTestV1.LoadTestType
Type returns backend type name
type Config ¶
type Config struct { ImageName string `envconfig:"K6_IMAGE_NAME" default:"grafana/k6"` ImageTag string `envconfig:"K6_IMAGE_TAG" default:"latest"` CPULimits string `envconfig:"K6_CPU_LIMITS"` CPURequests string `envconfig:"K6_CPU_REQUESTS"` MemoryLimits string `envconfig:"K6_MEMORY_LIMITS"` MemoryRequests string `envconfig:"K6_MEMORY_REQUESTS"` }
Config specific to k6 backend