Documentation ¶
Index ¶
- func RegisterError(err errors.AutoscalerError)
- func RegisterEvictions(podsCount int)
- func RegisterScaleDown(nodesCount int, reason NodeScaleDownReason)
- func RegisterScaleUp(nodesCount int)
- func UpdateClusterState(csr *clusterstate.ClusterStateRegistry)
- func UpdateDuration(label string, start time.Time)
- func UpdateLastTime(label string, now time.Time)
- func UpdateUnneededNodesCount(nodesCount int)
- func UpdateUnschedulablePodsCount(podsCount int)
- type HealthCheck
- type NodeScaleDownReason
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterError ¶
func RegisterError(err errors.AutoscalerError)
RegisterError records any errors preventing Cluster Autoscaler from working. No more than one error should be recorded per loop.
func RegisterEvictions ¶
func RegisterEvictions(podsCount int)
RegisterEvictions records number of evicted pods
func RegisterScaleDown ¶
func RegisterScaleDown(nodesCount int, reason NodeScaleDownReason)
RegisterScaleDown records number of nodes removed by scale down
func RegisterScaleUp ¶
func RegisterScaleUp(nodesCount int)
RegisterScaleUp records number of nodes added by scale up
func UpdateClusterState ¶
func UpdateClusterState(csr *clusterstate.ClusterStateRegistry)
UpdateClusterState updates metrics related to cluster state
func UpdateDuration ¶
UpdateDuration records the duration of the step identified by the label
func UpdateLastTime ¶
UpdateLastTime records the time the step identified by the label was started
func UpdateUnneededNodesCount ¶
func UpdateUnneededNodesCount(nodesCount int)
UpdateUnneededNodesCount records number of currently unneeded nodes
func UpdateUnschedulablePodsCount ¶
func UpdateUnschedulablePodsCount(podsCount int)
UpdateUnschedulablePodsCount records number of currently unschedulable pods
Types ¶
type HealthCheck ¶
type HealthCheck struct {
// contains filtered or unexported fields
}
HealthCheck contains information about last time of autoscaler activity and timeout
func NewHealthCheck ¶
func NewHealthCheck(activityTimeout, successTimeout time.Duration) *HealthCheck
NewHealthCheck builds new HealthCheck object with given timeout
func (*HealthCheck) ServeHTTP ¶
func (hc *HealthCheck) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.Handler interface to provide a health-check endpoint
func (*HealthCheck) StartMonitoring ¶
func (hc *HealthCheck) StartMonitoring()
StartMonitoring activates checks for autoscaler inactivity
func (*HealthCheck) UpdateLastActivity ¶
func (hc *HealthCheck) UpdateLastActivity(timestamp time.Time)
UpdateLastActivity updates last time of activity
func (*HealthCheck) UpdateLastSuccessfulRun ¶
func (hc *HealthCheck) UpdateLastSuccessfulRun(timestamp time.Time)
UpdateLastSuccessfulRun updates last time of successful (i.e. not ending in error) activity
type NodeScaleDownReason ¶
type NodeScaleDownReason string
NodeScaleDownReason describes reason for removing node
const ( // Underutilized node was removed because of low utilization Underutilized NodeScaleDownReason = "underutilized" // Empty node was removed Empty NodeScaleDownReason = "empty" // Unready node was removed Unready NodeScaleDownReason = "unready" )