podautoscaler

package
v1.6.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2017 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package podautoscaler contains logic for autoscaling number of pods based on metrics observed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnsafeConvertToVersionVia added in v1.6.0

func UnsafeConvertToVersionVia(obj runtime.Object, externalVersion schema.GroupVersion) (runtime.Object, error)

ConvertToVersionVia is like api.Scheme.ConvertToVersion, but it does so via an internal version first. We use it since working with v2alpha1 is convinient here, but we want to use the v1 client (and can't just use the internal version). Note that it does *not* guarantee a copy is made -- this should be done separately if we need to mutate the object.

Types

type HorizontalController

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

func (*HorizontalController) Run

func (a *HorizontalController) Run(stopCh <-chan struct{})

type ReplicaCalculator added in v1.5.0

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

func NewReplicaCalculator added in v1.5.0

func NewReplicaCalculator(metricsClient metricsclient.MetricsClient, podsGetter v1coreclient.PodsGetter) *ReplicaCalculator

func (*ReplicaCalculator) GetMetricReplicas added in v1.5.0

func (c *ReplicaCalculator) GetMetricReplicas(currentReplicas int32, targetUtilization int64, metricName string, namespace string, selector labels.Selector) (replicaCount int32, utilization int64, timestamp time.Time, err error)

GetMetricReplicas calculates the desired replica count based on a target metric utilization (as a milli-value) for pods matching the given selector in the given namespace, and the current replica count

func (*ReplicaCalculator) GetObjectMetricReplicas added in v1.6.0

func (c *ReplicaCalculator) GetObjectMetricReplicas(currentReplicas int32, targetUtilization int64, metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference) (replicaCount int32, utilization int64, timestamp time.Time, err error)

GetObjectMetricReplicas calculates the desired replica count based on a target metric utilization (as a milli-value) for the given object in the given namespace, and the current replica count.

func (*ReplicaCalculator) GetRawResourceReplicas added in v1.6.0

func (c *ReplicaCalculator) GetRawResourceReplicas(currentReplicas int32, targetUtilization int64, resource v1.ResourceName, namespace string, selector labels.Selector) (replicaCount int32, utilization int64, timestamp time.Time, err error)

GetRawResourceReplicas calculates the desired replica count based on a target resource utilization (as a raw milli-value) for pods matching the given selector in the given namespace, and the current replica count

func (*ReplicaCalculator) GetResourceReplicas added in v1.5.0

func (c *ReplicaCalculator) GetResourceReplicas(currentReplicas int32, targetUtilization int32, resource v1.ResourceName, namespace string, selector labels.Selector) (replicaCount int32, utilization int32, rawUtilization int64, timestamp time.Time, err error)

GetResourceReplicas calculates the desired replica count based on a target resource utilization percentage of the given resource for pods matching the given selector in the given namespace, and the current replica count

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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