Documentation ¶
Index ¶
- Constants
- Variables
- func ActuationSuiteE2eDescribe(name string, body func()) bool
- func AdmissionControllerE2eDescribe(name string, body func()) bool
- func CreateCPUHorizontalPodAutoscaler(rc *ResourceConsumer, cpu, minReplicas, maxRepl int32) *autoscalingv1.HorizontalPodAutoscaler
- func DeleteHorizontalPodAutoscaler(rc *ResourceConsumer, autoscalerName string)
- func E2eDescribe(scenario, name string, body func()) bool
- func FullVpaE2eDescribe(name string, body func()) bool
- func GetResourceConsumerImage() string
- func InstallVPA(f *framework.Framework, vpa *vpa_types.VerticalPodAutoscaler)
- func NewHamsterDeployment(f *framework.Framework) *appsv1.Deployment
- func NewHamsterDeploymentWithResources(f *framework.Framework, cpuQuantity, memoryQuantity resource.Quantity) *appsv1.Deployment
- func NewVPA(f *framework.Framework, name string, selector *metav1.LabelSelector) *vpa_types.VerticalPodAutoscaler
- func ParseQuantityOrDie(text string) resource.Quantity
- func RecommenderE2eDescribe(name string, body func()) bool
- func RunE2ETests(t *testing.T)
- func SIGDescribe(text string, body func()) bool
- func UpdaterE2eDescribe(name string, body func()) bool
- type ResourceConsumer
- func (rc *ResourceConsumer) CleanUp()
- func (rc *ResourceConsumer) ConsumeCPU(millicores int)
- func (rc *ResourceConsumer) ConsumeCustomMetric(amount int)
- func (rc *ResourceConsumer) ConsumeMem(megabytes int)
- func (rc *ResourceConsumer) EnsureDesiredReplicas(desiredReplicas int, duration time.Duration)
- func (rc *ResourceConsumer) GetReplicas() int
- func (rc *ResourceConsumer) Pause()
- func (rc *ResourceConsumer) Resume()
- func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int, duration time.Duration)
Constants ¶
const ( // VpaEvictionTimeout is a timeout for VPA to restart a pod if there are no // mechanisms blocking it (for example PDB). VpaEvictionTimeout = 3 * time.Minute )
Variables ¶
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 ActuationSuiteE2eDescribe ¶
ActuationSuiteE2eDescribe describes a VPA actuation e2e test.
func AdmissionControllerE2eDescribe ¶
AdmissionControllerE2eDescribe describes a VPA admission controller e2e test.
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 E2eDescribe ¶
E2eDescribe describes a VPA e2e test.
func FullVpaE2eDescribe ¶
FullVpaE2eDescribe describes a VPA full stack e2e test.
func GetResourceConsumerImage ¶
func GetResourceConsumerImage() string
GetResourceConsumerImage func
func InstallVPA ¶
func InstallVPA(f *framework.Framework, vpa *vpa_types.VerticalPodAutoscaler)
InstallVPA installs a VPA object in the test cluster.
func NewHamsterDeployment ¶
func NewHamsterDeployment(f *framework.Framework) *appsv1.Deployment
NewHamsterDeployment creates a simple hamster deployment for e2e test purposes.
func NewHamsterDeploymentWithResources ¶
func NewHamsterDeploymentWithResources(f *framework.Framework, cpuQuantity, memoryQuantity resource.Quantity) *appsv1.Deployment
NewHamsterDeploymentWithResources creates a simple hamster deployment with specific resource requests for e2e test purposes.
func NewVPA ¶
func NewVPA(f *framework.Framework, name string, selector *metav1.LabelSelector) *vpa_types.VerticalPodAutoscaler
NewVPA creates a VPA object for e2e test purposes.
func ParseQuantityOrDie ¶
ParseQuantityOrDie parses quantity from string and dies with an error if unparsable.
func RecommenderE2eDescribe ¶
RecommenderE2eDescribe describes a VPA recommender e2e test.
func RunE2ETests ¶
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.
func SIGDescribe ¶
SIGDescribe adds sig-autoscaling tag to test description.
func UpdaterE2eDescribe ¶
UpdaterE2eDescribe describes a VPA updater e2e test.
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) 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