autoscaling

package
v0.0.0-...-5343e98 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// KindRC var
	KindRC = schema.GroupVersionKind{Version: "v1", Kind: "ReplicationController"}
	// KindDeployment var
	KindDeployment = schema.GroupVersionKind{Group: "apps", Version: "v1beta2", Kind: "Deployment"}
	// KindReplicaSet var
	KindReplicaSet = schema.GroupVersionKind{Group: "apps", Version: "v1beta2", Kind: "ReplicaSet"}
)

Functions

func CreateCPUHorizontalPodAutoscaler

func CreateCPUHorizontalPodAutoscaler(rc *ResourceConsumer, cpu, minReplicas, maxRepl int32) *autoscalingv1.HorizontalPodAutoscaler

CreateCPUHorizontalPodAutoscaler func

func DeleteHorizontalPodAutoscaler

func DeleteHorizontalPodAutoscaler(rc *ResourceConsumer, autoscalerName string)

DeleteHorizontalPodAutoscaler func

func GetResourceConsumerImage

func GetResourceConsumerImage() string

GetResourceConsumerImage func

func RunE2ETests

func RunE2ETests(t *testing.T)

RunE2ETests checks configuration parameters (specified through flags) and then runs E2E tests using the Ginkgo runner. If a "report directory" is specified, one or more JUnit test reports will be generated in this directory, and cluster logs will also be saved. This function is called on each Ginkgo node in parallel mode.

Types

type ResourceConsumer

type ResourceConsumer struct {
	// contains filtered or unexported fields
}

ResourceConsumer is a tool for testing. It helps create specified usage of CPU or memory (Warning: memory not supported) typical use case: rc.ConsumeCPU(600) // ... check your assumption here rc.ConsumeCPU(300) // ... check your assumption here

func NewDynamicResourceConsumer

func NewDynamicResourceConsumer(name, nsName string, kind schema.GroupVersionKind, replicas, initCPUTotal, initMemoryTotal, initCustomMetric int, cpuRequest, memRequest resource.Quantity, clientset clientset.Interface, internalClientset *internalclientset.Clientset) *ResourceConsumer

NewDynamicResourceConsumer func

func NewStaticResourceConsumer

func NewStaticResourceConsumer(name, nsName string, replicas, initCPUTotal, initMemoryTotal, initCustomMetric int, cpuRequest, memRequest resource.Quantity, clientset clientset.Interface, internalClientset *internalclientset.Clientset) *ResourceConsumer

NewStaticResourceConsumer TODO this still defaults to replication controller

func (*ResourceConsumer) CleanUp

func (rc *ResourceConsumer) CleanUp()

CleanUp func

func (*ResourceConsumer) ConsumeCPU

func (rc *ResourceConsumer) ConsumeCPU(millicores int)

ConsumeCPU consumes given number of CPU

func (*ResourceConsumer) ConsumeCustomMetric

func (rc *ResourceConsumer) ConsumeCustomMetric(amount int)

ConsumeCustomMetric consumes given number of custom metric

func (*ResourceConsumer) ConsumeMem

func (rc *ResourceConsumer) ConsumeMem(megabytes int)

ConsumeMem consumes given number of Mem

func (*ResourceConsumer) EnsureDesiredReplicas

func (rc *ResourceConsumer) EnsureDesiredReplicas(desiredReplicas int, duration time.Duration)

EnsureDesiredReplicas func

func (*ResourceConsumer) GetReplicas

func (rc *ResourceConsumer) GetReplicas() int

GetReplicas func

func (*ResourceConsumer) Pause

func (rc *ResourceConsumer) Pause()

Pause stops background goroutines responsible for consuming resources.

func (*ResourceConsumer) Resume

func (rc *ResourceConsumer) Resume()

Resume starts background goroutines responsible for consuming resources.

func (*ResourceConsumer) WaitForReplicas

func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int, duration time.Duration)

WaitForReplicas func

Jump to

Keyboard shortcuts

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