package podautoscaler
import "k8s.io/kubernetes/pkg/controller/podautoscaler"
Package podautoscaler contains logic for autoscaling number of pods based on metrics observed.
Index ¶
- Constants
- type HorizontalController
- func NewHorizontalController( evtNamespacer v1core.EventsGetter, scaleNamespacer unversionedextensions.ScalesGetter, hpaNamespacer unversionedautoscaling.HorizontalPodAutoscalersGetter, replicaCalc *ReplicaCalculator, hpaInformer autoscalinginformers.HorizontalPodAutoscalerInformer, resyncPeriod time.Duration, ) *HorizontalController
- func (a *HorizontalController) Run(stopCh <-chan struct{})
- type ReplicaCalculator
- func NewReplicaCalculator(metricsClient metricsclient.MetricsClient, podsGetter v1core.PodsGetter) *ReplicaCalculator
- func (c *ReplicaCalculator) GetMetricReplicas(currentReplicas int32, targetUtilization float64, metricName string, namespace string, selector labels.Selector) (replicaCount int32, utilization float64, timestamp time.Time, err error)
- func (c *ReplicaCalculator) GetResourceReplicas(currentReplicas int32, targetUtilization int32, resource v1.ResourceName, namespace string, selector labels.Selector) (replicaCount int32, utilization int32, timestamp time.Time, err error)
Constants ¶
const ( HpaCustomMetricsTargetAnnotationName = "alpha/target.custom-metrics.podautoscaler.kubernetes.io" HpaCustomMetricsStatusAnnotationName = "alpha/status.custom-metrics.podautoscaler.kubernetes.io" )
Types ¶
type HorizontalController ¶
type HorizontalController struct {
// contains filtered or unexported fields
}
func NewHorizontalController ¶
func NewHorizontalController( evtNamespacer v1core.EventsGetter, scaleNamespacer unversionedextensions.ScalesGetter, hpaNamespacer unversionedautoscaling.HorizontalPodAutoscalersGetter, replicaCalc *ReplicaCalculator, hpaInformer autoscalinginformers.HorizontalPodAutoscalerInformer, resyncPeriod time.Duration, ) *HorizontalController
func (*HorizontalController) Run ¶
func (a *HorizontalController) Run(stopCh <-chan struct{})
type ReplicaCalculator ¶
type ReplicaCalculator struct {
// contains filtered or unexported fields
}
func NewReplicaCalculator ¶
func NewReplicaCalculator(metricsClient metricsclient.MetricsClient, podsGetter v1core.PodsGetter) *ReplicaCalculator
func (*ReplicaCalculator) GetMetricReplicas ¶
func (c *ReplicaCalculator) GetMetricReplicas(currentReplicas int32, targetUtilization float64, metricName string, namespace string, selector labels.Selector) (replicaCount int32, utilization float64, timestamp time.Time, err error)
GetMetricReplicas 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
func (*ReplicaCalculator) GetResourceReplicas ¶
func (c *ReplicaCalculator) GetResourceReplicas(currentReplicas int32, targetUtilization int32, resource v1.ResourceName, namespace string, selector labels.Selector) (replicaCount int32, utilization int32, 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
Source Files ¶
doc.go horizontal.go replica_calculator.go
Directories ¶
Path | Synopsis |
---|---|
pkg/controller/podautoscaler/metrics |
- Version
- v1.6.0-alpha.2
- Published
- Feb 12, 2017
- Platform
- js/wasm
- Imports
- 24 packages
- Last checked
- 10 minutes ago –
Tools for package owners.