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
- func Complete(a, b float64) float64
- func GetMaxVariance(m1 float64) float64
- func New(ctx context.Context, obj runtime.Object, handle framework.Handle) (framework.Plugin, error)
- func RegularizedIncomplete(x, a, b float64) float64
- type BetaDistribution
- func (b *BetaDistribution) DensityFunction(x float64) float64
- func (b *BetaDistribution) DistributionFunction(x float64) float64
- func (b *BetaDistribution) GetAlpha() float64
- func (b *BetaDistribution) GetBeta() float64
- func (b *BetaDistribution) MatchMoments(m1, m2 float64) bool
- func (b *BetaDistribution) Mean() float64
- func (b *BetaDistribution) Print() string
- func (b *BetaDistribution) Variance() float64
- type LowRiskOverCommitment
- func (pl *LowRiskOverCommitment) Name() string
- func (pl *LowRiskOverCommitment) NormalizeScore(context.Context, *framework.CycleState, *v1.Pod, framework.NodeScoreList) *framework.Status
- func (pl *LowRiskOverCommitment) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (pl *LowRiskOverCommitment) Score(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, ...) (int64, *framework.Status)
- func (pl *LowRiskOverCommitment) ScoreExtensions() framework.ScoreExtensions
- type PodResourcesStateData
Constants ¶
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 GetMaxVariance ¶
GetMaxVariance : Maximum variance for a given mean
func New ¶
func New(ctx context.Context, obj runtime.Object, handle framework.Handle) (framework.Plugin, error)
New : create an instance of a LowRiskOverCommitment plugin
func RegularizedIncomplete ¶
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 ¶
func (pl *LowRiskOverCommitment) NormalizeScore(context.Context, *framework.CycleState, *v1.Pod, framework.NodeScoreList) *framework.Status
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 ¶
func (s *PodResourcesStateData) Clone() framework.StateData
Clone : clone the pod resource state data