clusterloader

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: 26 Imported by: 1

Documentation

Overview

Package clusterloader installs clusterloader. Replace https://github.com/aws/aws-k8s-tester/tree/v1.5.9/eks/cluster-loader.

Index

Constants

View Source
const (
	DefaultNodesPerNamespace = 10
	DefaultPodsPerNode       = 10

	DefaultBigGroupSize    = 25
	DefaultMediumGroupSize = 10
	DefaultSmallGroupSize  = 5

	DefaultSmallStatefulSetsPerNamespace  = 0
	DefaultMediumStatefulSetsPerNamespace = 0

	DefaultCL2UseHostNetworkPods           = false
	DefaultCL2LoadTestThroughput           = 20
	DefaultCL2EnablePVS                    = false
	DefaultCL2SchedulerThroughputThreshold = 100
	DefaultPrometheusScrapeKubeProxy       = false
	DefaultEnableSystemPodMetrics          = false
)
View Source
const (
	DefaultMinimumNodes int = 1

	DefaultRuns       = 2
	DefaultRunTimeout = 30 * time.Minute

	DefaultRunFromCluster    = false
	DefaultNodes             = 10
	DefaultEnableExecService = false
)
View Source
const DefaultProvider = "eks"

Variables

This section is empty.

Functions

func DefaultClusterloaderDownloadURL

func DefaultClusterloaderDownloadURL() string

func DefaultClusterloaderPath

func DefaultClusterloaderPath() string

func DefaultPodStartupLatencyPath

func DefaultPodStartupLatencyPath() string

func DefaultTestLogPath

func DefaultTestLogPath() string

func DefaultTestOverridePath

func DefaultTestOverridePath() string

func DefaultTestReportDir

func DefaultTestReportDir() string

func DefaultTestReportDirTarGzPath

func DefaultTestReportDirTarGzPath() string

func Env

func Env() string

func EnvTestOverride

func EnvTestOverride() 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"`

	// ClusterloaderPath is the path to download the "clusterloader".
	ClusterloaderPath string `json:"clusterloader_path"`
	// ClusterloaderDownloadURL is the download URL to download "clusterloader" binary from.
	ClusterloaderDownloadURL string `json:"clusterloader_download_url"`

	// Provider is the provider name for "clusterloader2".
	Provider string `json:"provider"`

	// Runs is the number of "clusterloader2" runs back-to-back.
	Runs int `json:"runs"`
	// RunTimeout is the timeout for the total test runs.
	RunTimeout       time.Duration `json:"run_timeout"`
	RunTimeoutString string        `json:"run_timeout_string" read-only:"true"`

	// TestConfigPath is the clusterloader2 test configuration file.
	// Must be located along with other configuration files.
	// For instance, if the clusterloader2 default configuration file is located at
	// ${HOME}/go/src/k8s.io/perf-tests/clusterloader2/testing/load/config.yaml,
	// then run this tester from "${HOME}/go/src/k8s.io/perf-tests/clusterloader2".
	// ref. https://github.com/kubernetes/perf-tests/blob/master/clusterloader2/testing/load/config.yaml
	// Set via "--testconfig" flag.
	TestConfigPath string `json:"test_config_path"`

	// RunFromCluster is set 'true' to override KUBECONFIG set in "Client" field.
	// If "false", instead pass Client.Config().KubeconfigPath to "--kubeconfig" flag.
	// Set via "--run-from-cluster" flag.
	// ref. https://github.com/kubernetes/perf-tests/pull/1295
	RunFromCluster bool `json:"run_from_cluster"`
	// Nodes is the number of nodes.
	// Set via "--nodes" flag.
	Nodes int `json:"nodes"`
	// EnableExecService is set to "true" to allow executing arbitrary commands from a pod running in the cluster.
	// Set via "--enable-exec-service" flag.
	// ref. https://github.com/kubernetes/perf-tests/blob/master/clusterloader2/cmd/clusterloader.go#L120
	EnableExecService bool `json:"enable_exec_service"`

	// TestOverride defines "testoverrides" flag values.
	// Set via "--testoverrides" flag.
	// See https://github.com/kubernetes/perf-tests/tree/master/clusterloader2/testing/overrides for more.
	// ref. https://github.com/kubernetes/perf-tests/pull/1345
	TestOverride *TestOverride `json:"test_override"`

	// TestReportDir is the clusterloader2 test report output directory.
	// Set via "--report-dir" flag.
	TestReportDir string `json:"test_report_dir" read-only:"true"`
	// TestReportDirTarGzPath is the test report .tar.gz file path.
	TestReportDirTarGzPath string `json:"test_report_dir_tar_gz_path" read-only:"true"`
	// TestLogPath is the "clusterloader2" test log file path.
	TestLogPath string `json:"test_log_path" read-only:"true"`
	// PodStartupLatency is the result of clusterloader runs.
	PodStartupLatency PerfData `json:"pod_startup_latency" read-only:"true"`
	// PodStartupLatencyPath is the JSON file path to store pod startup latency.
	PodStartupLatencyPath string `json:"pod_startup_latency_path" read-only:"true"`
}

Config defines parameters for Kubernetes clusterloader tests.

func NewDefault

func NewDefault() *Config

func (*Config) ValidateAndSetDefaults

func (cfg *Config) ValidateAndSetDefaults() error

type DataItem

type DataItem struct {
	// Data is a map from bucket to real data point (e.g. "Perc90" -> 23.5). Notice
	// that all data items with the same label combination should have the same buckets.
	Data map[string]float64 `json:"data"`
	// Unit is the data unit. Notice that all data items with the same label combination
	// should have the same unit.
	Unit string `json:"unit"`
	// Labels is the labels of the data item.
	Labels map[string]string `json:"labels,omitempty"`
}

Copy from: https://pkg.go.dev/k8s.io/perf-tests/clusterloader2/pkg/measurement/util#DataItem

type PerfData

type PerfData struct {
	// Version is the version of the metrics. The metrics consumer could use the version
	// to detect metrics version change and decide what version to support.
	Version   string     `json:"version"`
	DataItems []DataItem `json:"dataItems"`
	// Labels is the labels of the dataset.
	Labels map[string]string `json:"labels,omitempty"`
}

Copy from: https://pkg.go.dev/k8s.io/perf-tests/clusterloader2/pkg/measurement/util#PerfData

type TestOverride

type TestOverride struct {
	// Path is the test override YAML file path.
	Path string `json:"path" read-only:"true"`

	NodesPerNamespace int `json:"nodes_per_namespace"`
	PodsPerNode       int `json:"pods_per_node"`

	BigGroupSize    int `json:"big_group_size"`
	MediumGroupSize int `json:"medium_group_size"`
	SmallGroupSize  int `json:"small_group_size"`

	SmallStatefulSetsPerNamespace  int `json:"small_stateful_sets_per_namespace"`
	MediumStatefulSetsPerNamespace int `json:"medium_stateful_sets_per_namespace"`

	CL2UseHostNetworkPods           bool `json:"cl2_use_host_network_pods"`
	CL2LoadTestThroughput           int  `json:"cl2_load_test_throughput"`
	CL2EnablePVS                    bool `json:"cl2_enable_pvs"`
	CL2SchedulerThroughputThreshold int  `json:"cl2_scheduler_throughput_threshold"`
	PrometheusScrapeKubeProxy       bool `json:"prometheus_scrape_kube_proxy"`
	EnableSystemPodMetrics          bool `json:"enable_system_pod_metrics"`
}

func (*TestOverride) Sync

func (to *TestOverride) Sync(lg *zap.Logger) error

Directories

Path Synopsis
cmd
k8s-tester-clusterloader
k8s-tester-clusterloader installs Kubernetes clusterloader tester.
k8s-tester-clusterloader installs Kubernetes clusterloader tester.

Jump to

Keyboard shortcuts

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