const dynamicConsumptionTimeInSeconds …
const dynamicRequestSizeInMillicores …
const dynamicRequestSizeInMegabytes …
const dynamicRequestSizeCustomMetric …
const port …
const targetPort …
const sidecarTargetPort …
const timeoutRC …
const startServiceTimeout …
const startServiceInterval …
const invalidKind …
const customMetricName …
const serviceInitializationTimeout …
const serviceInitializationInterval …
const megabytes …
const crdVersion …
const crdKind …
const crdGroup …
const crdName …
const crdNamePlural …
var KindRC …
var KindDeployment …
var KindReplicaSet …
var KindCRD …
type ScalingDirection …
const DirectionUnknown …
const ScaleUpDirection …
const ScaleDownDirection …
type ResourceConsumer …
func NewDynamicResourceConsumer(ctx context.Context, name, nsName string, kind schema.GroupVersionKind, replicas, initCPUTotal, initMemoryTotal, initCustomMetric int, cpuLimit, memLimit int64, clientset clientset.Interface, scaleClient scaleclient.ScalesGetter, enableSidecar SidecarStatusType, sidecarType SidecarWorkloadType) *ResourceConsumer { … }
func getSidecarContainer(name string, cpuLimit, memLimit int64) v1.Container { … }
func newResourceConsumer(ctx context.Context, name, nsName string, kind schema.GroupVersionKind, replicas, initCPUTotal, initMemoryTotal, initCustomMetric, consumptionTimeInSeconds, requestSizeInMillicores,
requestSizeInMegabytes int, requestSizeCustomMetric int, cpuLimit, memLimit int64, clientset clientset.Interface, scaleClient scaleclient.ScalesGetter, podAnnotations, serviceAnnotations map[string]string, sidecarStatus SidecarStatusType, sidecarType SidecarWorkloadType) *ResourceConsumer { … }
func (rc *ResourceConsumer) ConsumeCPU(millicores int) { … }
func (rc *ResourceConsumer) ConsumeMem(megabytes int) { … }
func (rc *ResourceConsumer) ConsumeCustomMetric(amount int) { … }
func (rc *ResourceConsumer) makeConsumeCPURequests(ctx context.Context) { … }
func (rc *ResourceConsumer) makeConsumeMemRequests(ctx context.Context) { … }
func (rc *ResourceConsumer) makeConsumeCustomMetric(ctx context.Context) { … }
func (rc *ResourceConsumer) sendConsumeCPURequest(ctx context.Context, millicores int) { … }
func (rc *ResourceConsumer) sendConsumeMemRequest(ctx context.Context, megabytes int) { … }
func (rc *ResourceConsumer) sendConsumeCustomMetric(ctx context.Context, delta int) { … }
func (rc *ResourceConsumer) GetReplicas(ctx context.Context) (int, error) { … }
func (rc *ResourceConsumer) GetHpa(ctx context.Context, name string) (*autoscalingv1.HorizontalPodAutoscaler, error) { … }
func (rc *ResourceConsumer) WaitForReplicas(ctx context.Context, desiredReplicas int, duration time.Duration) { … }
func (rc *ResourceConsumer) EnsureDesiredReplicasInRange(ctx context.Context, minDesiredReplicas, maxDesiredReplicas int, duration time.Duration, hpaName string) { … }
func (rc *ResourceConsumer) Pause() { … }
func (rc *ResourceConsumer) Resume(ctx context.Context) { … }
func (rc *ResourceConsumer) CleanUp(ctx context.Context) { … }
func createService(ctx context.Context, c clientset.Interface, name, ns string, annotations, selectors map[string]string, port int32, targetPort int) (*v1.Service, error) { … }
func runServiceAndSidecarForResourceConsumer(ctx context.Context, c clientset.Interface, ns, name string, kind schema.GroupVersionKind, replicas int, serviceAnnotations map[string]string) { … }
func runServiceAndWorkloadForResourceConsumer(ctx context.Context, c clientset.Interface, resourceClient dynamic.ResourceInterface, apiExtensionClient crdclientset.Interface, ns, name string, kind schema.GroupVersionKind, replicas int, cpuLimitMillis, memLimitMb int64, podAnnotations, serviceAnnotations map[string]string, additionalContainers []v1.Container) { … }
func CreateHorizontalPodAutoscaler(ctx context.Context, rc *ResourceConsumer, targetRef autoscalingv2.CrossVersionObjectReference, namespace string, metrics []autoscalingv2.MetricSpec, resourceType v1.ResourceName, metricTargetType autoscalingv2.MetricTargetType, metricTargetValue, minReplicas, maxReplicas int32) *autoscalingv2.HorizontalPodAutoscaler { … }
func CreateResourceHorizontalPodAutoscaler(ctx context.Context, rc *ResourceConsumer, resourceType v1.ResourceName, metricTargetType autoscalingv2.MetricTargetType, metricTargetValue, minReplicas, maxReplicas int32) *autoscalingv2.HorizontalPodAutoscaler { … }
func CreateCPUResourceHorizontalPodAutoscaler(ctx context.Context, rc *ResourceConsumer, cpu, minReplicas, maxReplicas int32) *autoscalingv2.HorizontalPodAutoscaler { … }
func DeleteHorizontalPodAutoscaler(ctx context.Context, rc *ResourceConsumer, autoscalerName string) { … }
func runReplicaSet(ctx context.Context, config testutils.ReplicaSetConfig) error { … }
func CreateContainerResourceHorizontalPodAutoscaler(ctx context.Context, rc *ResourceConsumer, resourceType v1.ResourceName, metricTargetType autoscalingv2.MetricTargetType, metricTargetValue, minReplicas, maxReplicas int32) *autoscalingv2.HorizontalPodAutoscaler { … }
func DeleteContainerResourceHPA(ctx context.Context, rc *ResourceConsumer, autoscalerName string) { … }
func CreateMetricTargetWithType(resourceType v1.ResourceName, targetType autoscalingv2.MetricTargetType, targetValue int32) autoscalingv2.MetricTarget { … }
func CreateCPUHorizontalPodAutoscalerWithBehavior(ctx context.Context, rc *ResourceConsumer, cpu int32, minReplicas int32, maxRepl int32, behavior *autoscalingv2.HorizontalPodAutoscalerBehavior) *autoscalingv2.HorizontalPodAutoscaler { … }
func HPABehaviorWithScaleUpAndDownRules(scaleUpRule, scaleDownRule *autoscalingv2.HPAScalingRules) *autoscalingv2.HorizontalPodAutoscalerBehavior { … }
func HPABehaviorWithScalingRuleInDirection(scalingDirection ScalingDirection, rule *autoscalingv2.HPAScalingRules) *autoscalingv2.HorizontalPodAutoscalerBehavior { … }
func HPAScalingRuleWithStabilizationWindow(stabilizationDuration int32) *autoscalingv2.HPAScalingRules { … }
func HPAScalingRuleWithPolicyDisabled() *autoscalingv2.HPAScalingRules { … }
func HPAScalingRuleWithScalingPolicy(policyType autoscalingv2.HPAScalingPolicyType, value, periodSeconds int32) *autoscalingv2.HPAScalingRules { … }
func HPABehaviorWithStabilizationWindows(upscaleStabilization, downscaleStabilization time.Duration) *autoscalingv2.HorizontalPodAutoscalerBehavior { … }
func HPABehaviorWithScaleDisabled(scalingDirection ScalingDirection) *autoscalingv2.HorizontalPodAutoscalerBehavior { … }
func HPABehaviorWithScaleLimitedByNumberOfPods(scalingDirection ScalingDirection, numberOfPods, periodSeconds int32) *autoscalingv2.HorizontalPodAutoscalerBehavior { … }
func HPABehaviorWithScaleLimitedByPercentage(scalingDirection ScalingDirection, percentage, periodSeconds int32) *autoscalingv2.HorizontalPodAutoscalerBehavior { … }
func DeleteHPAWithBehavior(ctx context.Context, rc *ResourceConsumer, autoscalerName string) { … }
type SidecarStatusType …
const Enable …
const Disable …
type SidecarWorkloadType …
const Busy …
const Idle …
func CreateCustomResourceDefinition(ctx context.Context, c crdclientset.Interface) *apiextensionsv1.CustomResourceDefinition { … }
func CreateCustomSubresourceInstance(ctx context.Context, namespace, name string, client dynamic.ResourceInterface, definition *apiextensionsv1.CustomResourceDefinition) (*unstructured.Unstructured, error) { … }