kubernetes: k8s.io/kubernetes/test/e2e/framework/autoscaling Index | Files

package autoscaling

import "k8s.io/kubernetes/test/e2e/framework/autoscaling"


Package Files



var (
    // KindRC is the GVK for ReplicationController
    KindRC = schema.GroupVersionKind{Version: "v1", Kind: "ReplicationController"}
    // KindDeployment is the GVK for Deployment
    KindDeployment = schema.GroupVersionKind{Group: "apps", Version: "v1beta2", Kind: "Deployment"}
    // KindReplicaSet is the GVK for ReplicaSet
    KindReplicaSet = schema.GroupVersionKind{Group: "apps", Version: "v1beta2", Kind: "ReplicaSet"}

func CreateCPUHorizontalPodAutoscaler Uses

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

CreateCPUHorizontalPodAutoscaler create a horizontalPodAutoscaler with CPU target for consuming resources.

func DeleteHorizontalPodAutoscaler Uses

func DeleteHorizontalPodAutoscaler(rc *ResourceConsumer, autoscalerName string)

DeleteHorizontalPodAutoscaler delete the horizontalPodAutoscaler for consuming resources.

type ResourceConsumer Uses

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 Uses

func NewDynamicResourceConsumer(name, nsName string, kind schema.GroupVersionKind, replicas, initCPUTotal, initMemoryTotal, initCustomMetric int, cpuLimit, memLimit int64, clientset clientset.Interface, scaleClient scaleclient.ScalesGetter) *ResourceConsumer

NewDynamicResourceConsumer is a wrapper to create a new dynamic ResourceConsumer

func (*ResourceConsumer) CleanUp Uses

func (rc *ResourceConsumer) CleanUp()

CleanUp clean up the background goroutines responsible for consuming resources.

func (*ResourceConsumer) ConsumeCPU Uses

func (rc *ResourceConsumer) ConsumeCPU(millicores int)

ConsumeCPU consumes given number of CPU

func (*ResourceConsumer) ConsumeCustomMetric Uses

func (rc *ResourceConsumer) ConsumeCustomMetric(amount int)

ConsumeCustomMetric consumes given number of custom metric

func (*ResourceConsumer) ConsumeMem Uses

func (rc *ResourceConsumer) ConsumeMem(megabytes int)

ConsumeMem consumes given number of Mem

func (*ResourceConsumer) EnsureDesiredReplicasInRange Uses

func (rc *ResourceConsumer) EnsureDesiredReplicasInRange(minDesiredReplicas, maxDesiredReplicas int, duration time.Duration, hpaName string)

EnsureDesiredReplicasInRange ensure the replicas is in a desired range

func (*ResourceConsumer) GetHpa Uses

func (rc *ResourceConsumer) GetHpa(name string) (*autoscalingv1.HorizontalPodAutoscaler, error)

GetHpa get the corresponding horizontalPodAutoscaler object

func (*ResourceConsumer) GetReplicas Uses

func (rc *ResourceConsumer) GetReplicas() int

GetReplicas get the replicas

func (*ResourceConsumer) Pause Uses

func (rc *ResourceConsumer) Pause()

Pause stops background goroutines responsible for consuming resources.

func (*ResourceConsumer) Resume Uses

func (rc *ResourceConsumer) Resume()

Resume starts background goroutines responsible for consuming resources.

func (*ResourceConsumer) WaitForReplicas Uses

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

WaitForReplicas wait for the desired replicas

Package autoscaling imports 21 packages (graph) and is imported by 52 packages. Updated 2020-03-25. Refresh now. Tools for package owners.