stress

package module
v0.0.0-...-6d46272 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Overview

Package stress implements stress tester using "Pod" objects. Do not parallelize locally, instead parallelize by distributing workers across nodes. It uses "Update" for stressing writes, and "List" for stressing reads. Both Kubernetes "Create" and "Update" are same for etcd, as they are etcd mutable transactions. See "k8s.io/apiserver/pkg/storage/etcd3/store.go" for "Create" and "GuaranteedUpdate". To only test creates, see "k8s-tester/configmaps" and "k8s-tester/secrets". To test large-size writes, also see "k8s-tester/jobs-echo". Replace https://github.com/aws/aws-k8s-tester/tree/v1.5.9/eks/stresser. Replace https://github.com/aws/aws-k8s-tester/tree/v1.5.9/eks/stresser2.

Index

Constants

View Source
const (
	DefaultMinimumNodes          int = 1
	DefaultSkipNamespaceCreation     = false

	DefaultRunTimeout = time.Minute

	DefaultObjects    int = -1
	DefaultObjectSize int = 10 * 1024 // 10 KB

	DefaultUpdateConcurrency int   = 10
	DefaultListBatchLimit    int64 = 1000
)

Variables

This section is empty.

Functions

func DefaultObjectKeyPrefix

func DefaultObjectKeyPrefix() string

func Env

func Env() string

func EnvRepository

func EnvRepository() string

func New

func New(cfg *Config) k8s_tester.Tester

Types

type Config

type Config struct {
	Enable bool `json:"enable"`
	Prompt bool `json:"-"`

	Stopc     chan struct{} `json:"-"`
	Logger    *zap.Logger   `json:"-"`
	LogWriter io.Writer     `json:"-"`
	Client    client.Client `json:"-"`

	// MinimumNodes is the minimum number of Kubernetes nodes required for installing this addon.
	MinimumNodes int `json:"minimum_nodes"`
	// Namespace to create test resources.
	Namespace             string `json:"namespace"`
	SkipNamespaceCreation bool   `json:"skip_namespace_creation"`

	// ECRBusyboxImage is the ECR image URI with tag.
	// If not empty, it skips ECR repository describe calls.
	ECRBusyboxImage string `json:"ecr_busybox_image"`
	// Repository defines a custom ECR image repository.
	// For "busybox".
	Repository *aws_v1_ecr.Repository `json:"busybox_repository,omitempty"`

	// RunTimeout is the duration of stress runs.
	// After timeout, it stops all stress requests.
	RunTimeout       time.Duration `json:"run_timeout"`
	RunTimeoutString string        `json:"run_timeout_string" read-only:"true"`
	// ObjectKeyPrefix is the key prefix for "Pod" objects.
	ObjectKeyPrefix string `json:"object_key_prefix"`
	// Objects is the desired number of objects to create and update.
	// This doesn't apply to reads.
	// If negative, it creates until timeout.
	Objects int `json:"objects"`
	// ObjectSize is the size in bytes per object.
	ObjectSize int `json:"object_size"`
	// UpdateConcurrency is the number of concurrent routines to issue update requests.
	// Do not set too high, instead distribute this tester as distributed workers to maximize concurrency.
	UpdateConcurrency int `json:"update_concurrency"`
	// ListBatchLimit is the number of objects to return for each list response.
	// If negative, the tester disables list calls (only runs mutable requests).
	ListBatchLimit int64 `json:"list_batch_limit"`

	// LatencySummaryWrites represents latencies for "Create" and "Update" requests.
	LatencySummaryWrites latency.Summary `json:"latency_summary_writes" read-only:"true"`
	// LatencySummaryGets represents latencies for "Get" requests.
	LatencySummaryGets latency.Summary `json:"latency_summary_gets" read-only:"true"`
	// LatencySummaryRangeGets represents latencies for "List" requests.
	LatencySummaryRangeGets latency.Summary `json:"latency_summary_range_gets" read-only:"true"`
}

func NewDefault

func NewDefault() *Config

func (*Config) ValidateAndSetDefaults

func (cfg *Config) ValidateAndSetDefaults() error

Directories

Path Synopsis
cmd
k8s-tester-stress
k8s-tester-stress installs Kubernetes stress tester.
k8s-tester-stress installs Kubernetes stress tester.
Package in_cluster implements stress tester in remote worker nodes which runs workloads against its Kubernetes control plane, thus "in cluster".
Package in_cluster implements stress tester in remote worker nodes which runs workloads against its Kubernetes control plane, thus "in cluster".

Jump to

Keyboard shortcuts

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