lowriskovercommitment

package
v0.30.6 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

README

LowRiskOverCommitment Plugin

The LowRiskOverCommitment plugin is one of the Trimaran scheduler plugins, described in Trimaran: Real Load Aware Scheduling. The Trimaran plugins employ the load-watcher in order to collect measurements from the nodes as described here.

Though containers are allowed to specify resource limit values beyond the requested (guaranteed) values, most schedulers are only concerned with the requested values. This may result in a cluster where some (or all) nodes are overcommitted, thus leading to potential CPU congestion and performance degradation and/or memory OOM situations and pod evictions. The LowRiskOverCommitment plugin takes into consideration (1) the resource limit values of pods (limit-aware) and (2) the actual load (utilization) on the nodes (load-aware) could provide a low risk environment for pods and alleviate issues with overcommitment, while allowing pods to use their limits.

The LowRiskOverCommitment plugin evaluates the performance risk of overcommitment and selects the node with lowest risk. It achieves this goal by combining two risk factors: limit risk and load risk. The limit risk is based on requests and limits values. And, the load risk is based on observed load. LowRiskOverCommitment is risk-aware as well as load-aware. The outcome is that burstable and best effort pods are placed on nodes where the chance of being impacted by overcommitment is minimized, while providing them a chance to burst up to their full limits.

The LowRiskOverCommitment plugin has the following configuration parameters:

  • smoothingWindowSize : The number of windows over which metrics are smoothed. (Default 5)
  • riskLimitWeights : A map resource weights (between 0 and 1) of risk due to limit specifications (as opposed to risk due to load utilization). (Default [cpu: 0.5, memory: 0.5])

In addition, we have the metricProviderconfiguration parameters, depending on whether the load-watcher is in service or library mode, respectively.

Following is an example scheduler configuration with the LowRiskOverCommitment plugin enabled, and using the load-watcher in library mode, collecting measurements from the Prometheus server.

apiVersion: kubescheduler.config.k8s.io/v1
kind: KubeSchedulerConfiguration
leaderElection:
  leaderElect: false
profiles:
- schedulerName: trimaran
  plugins:
    score:
      enabled:
       - name: LowRiskOverCommitment
  pluginConfig:
  - name: LowRiskOverCommitment
    args:
      smoothingWindowSize: 5
      riskLimitWeights:
        cpu: 0.5
        memory: 0.5
      metricProvider:
        type: Prometheus
        address: http://prometheus-k8s.monitoring.svc.cluster.local:9090

Documentation

Overview

Copyright 2023 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// Name : name of plugin
	Name = "LowRiskOverCommitment"

	// MaxVarianceAllowance : allowed value from the maximum variance (to avoid zero divisions)
	MaxVarianceAllowance = 0.99

	// PodResourcesKey State key used in CycleState
	PodResourcesKey = Name + ".PodResources"
)

Variables

This section is empty.

Functions

func Complete

func Complete(a, b float64) float64

Complete : complete beta function, B(a,b), a,b > 0

func GetMaxVariance

func GetMaxVariance(m1 float64) float64

GetMaxVariance : Maximum variance for a given mean

func New

New : create an instance of a LowRiskOverCommitment plugin

func RegularizedIncomplete

func RegularizedIncomplete(x, a, b float64) float64

RegularizedIncomplete : I_x(a,b) = B(x;a,b) / B(a,b), a,b > 0, x in [0,1], where B(x;a,b) is the incomplete and B(a,b) is the complete beta function

Types

type BetaDistribution

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

BetaDistribution :

http://en.wikipedia.org/wiki/Beta_distribution
alpha shape parameter (alpha > 0)
beta shape parameter (beta > 0)

func ComputeProbability

func ComputeProbability(mu, sigma, threshold float64) (float64, *BetaDistribution)

ComputeProbability : The probability that the resource utilization is less than or equal to a given threshold value

func NewBetaDistribution

func NewBetaDistribution(alpha, beta float64) *BetaDistribution

NewBetaDistribution : constructor

func (*BetaDistribution) DensityFunction

func (b *BetaDistribution) DensityFunction(x float64) float64

DensityFunction : Probability density function, pdf(x) of random variable X. The probability that x < X < x + dx.

func (*BetaDistribution) DistributionFunction

func (b *BetaDistribution) DistributionFunction(x float64) float64

DistributionFunction : Probability distribution function, PDF(x) of random variable X. The probability that X <= x.

func (*BetaDistribution) GetAlpha

func (b *BetaDistribution) GetAlpha() float64

GetAlpha : the alpha parameter

func (*BetaDistribution) GetBeta

func (b *BetaDistribution) GetBeta() float64

GetBeta : the beta parameter

func (*BetaDistribution) MatchMoments

func (b *BetaDistribution) MatchMoments(m1, m2 float64) bool

MatchMoments : Match the first two moments: m1 and m2

func (*BetaDistribution) Mean

func (b *BetaDistribution) Mean() float64

Mean : E[X], the mean of the random variable X.

func (*BetaDistribution) Print

func (b *BetaDistribution) Print() string

Print : toString() of the distribution

func (*BetaDistribution) Variance

func (b *BetaDistribution) Variance() float64

Variance : V[X], the variance of the random variable X. V[X] = E[X^2] - (E[X])^2

type LowRiskOverCommitment

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

LowRiskOverCommitment : scheduler plugin

func (*LowRiskOverCommitment) Name

func (pl *LowRiskOverCommitment) Name() string

Name : name of plugin

func (*LowRiskOverCommitment) NormalizeScore

NormalizeScore : normalize scores

func (*LowRiskOverCommitment) PreScore

func (pl *LowRiskOverCommitment) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*framework.NodeInfo) *framework.Status

PreScore : calculate pod requests and limits and store as plugin state data to be used during scoring

func (*LowRiskOverCommitment) Score

func (pl *LowRiskOverCommitment) Score(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)

Score : evaluate score for a node

func (*LowRiskOverCommitment) ScoreExtensions

func (pl *LowRiskOverCommitment) ScoreExtensions() framework.ScoreExtensions

ScoreExtensions : an interface for Score extended functionality

type PodResourcesStateData

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

PodResourcesStateData : computed at PreScore and used at Score

func CreatePodResourcesStateData

func CreatePodResourcesStateData(pod *v1.Pod) *PodResourcesStateData

CreatePodResourcesStateData : calculate pod resource requests and limits and store as plugin state data

func (*PodResourcesStateData) Clone

Clone : clone the pod resource state data

Jump to

Keyboard shortcuts

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