kubernetes: k8s.io/kubernetes/pkg/controller/podautoscaler Index | Files | Directories

package podautoscaler

import "k8s.io/kubernetes/pkg/controller/podautoscaler"

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

Index

Package Files

doc.go horizontal.go rate_limiters.go replica_calculator.go

func NewDefaultHPARateLimiter Uses

func NewDefaultHPARateLimiter(interval time.Duration) workqueue.RateLimiter

NewDefaultHPARateLimiter creates a rate limiter which limits overall (as per the default controller rate limiter), as well as per the resync interval

func NewFixedItemIntervalRateLimiter Uses

func NewFixedItemIntervalRateLimiter(interval time.Duration) workqueue.RateLimiter

type FixedItemIntervalRateLimiter Uses

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

FixedItemIntervalRateLimiter limits items to a fixed-rate interval

func (*FixedItemIntervalRateLimiter) Forget Uses

func (r *FixedItemIntervalRateLimiter) Forget(item interface{})

func (*FixedItemIntervalRateLimiter) NumRequeues Uses

func (r *FixedItemIntervalRateLimiter) NumRequeues(item interface{}) int

func (*FixedItemIntervalRateLimiter) When Uses

func (r *FixedItemIntervalRateLimiter) When(item interface{}) time.Duration

type HorizontalController Uses

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

HorizontalController is responsible for the synchronizing HPA objects stored in the system with the actual deployments/replication controllers they control.

func NewHorizontalController Uses

func NewHorizontalController(
    evtNamespacer v1core.EventsGetter,
    scaleNamespacer scaleclient.ScalesGetter,
    hpaNamespacer autoscalingclient.HorizontalPodAutoscalersGetter,
    mapper apimeta.RESTMapper,
    metricsClient metricsclient.MetricsClient,
    hpaInformer autoscalinginformers.HorizontalPodAutoscalerInformer,
    podInformer coreinformers.PodInformer,
    resyncPeriod time.Duration,
    downscaleStabilisationWindow time.Duration,
    tolerance float64,
    cpuInitializationPeriod,
    delayOfInitialReadinessStatus time.Duration,

) *HorizontalController

NewHorizontalController creates a new HorizontalController.

func (*HorizontalController) Run Uses

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

Run begins watching and syncing.

type ReplicaCalculator Uses

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

func NewReplicaCalculator Uses

func NewReplicaCalculator(metricsClient metricsclient.MetricsClient, podLister corelisters.PodLister, tolerance float64, cpuInitializationPeriod, delayOfInitialReadinessStatus time.Duration) *ReplicaCalculator

func (*ReplicaCalculator) GetExternalMetricReplicas Uses

func (c *ReplicaCalculator) GetExternalMetricReplicas(currentReplicas int32, targetUtilization int64, metricName, namespace string, metricSelector *metav1.LabelSelector, podSelector labels.Selector) (replicaCount int32, utilization int64, timestamp time.Time, err error)

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

func (*ReplicaCalculator) GetExternalPerPodMetricReplicas Uses

func (c *ReplicaCalculator) GetExternalPerPodMetricReplicas(statusReplicas int32, targetUtilizationPerPod int64, metricName, namespace string, metricSelector *metav1.LabelSelector) (replicaCount int32, utilization int64, timestamp time.Time, err error)

GetExternalPerPodMetricReplicas calculates the desired replica count based on a target metric value per pod (as a milli-value) for the external metric in the given namespace, and the current replica count.

func (*ReplicaCalculator) GetMetricReplicas Uses

func (c *ReplicaCalculator) GetMetricReplicas(currentReplicas int32, targetUtilization int64, metricName string, namespace string, selector labels.Selector, metricSelector 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 Uses

func (c *ReplicaCalculator) GetObjectMetricReplicas(currentReplicas int32, targetUtilization int64, metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, selector labels.Selector, metricSelector labels.Selector) (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) GetObjectPerPodMetricReplicas Uses

func (c *ReplicaCalculator) GetObjectPerPodMetricReplicas(statusReplicas int32, targetAverageUtilization int64, metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (replicaCount int32, utilization int64, timestamp time.Time, err error)

GetObjectPerPodMetricReplicas 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 Uses

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 Uses

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

PathSynopsis
config
config/v1alpha1
metrics

Package podautoscaler imports 33 packages (graph) and is imported by 122 packages. Updated 2019-11-22. Refresh now. Tools for package owners.