loadAware

package
v0.0.0-...-03bd2fb Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MinResourcePercentage is the minimum value of a resource's percentage
	MinResourcePercentage = 0
	// MaxResourcePercentage is the maximum value of a resource's percentage
	MaxResourcePercentage = 100
)
View Source
const LoadAwarePluginName = "LoadAware"

Variables

This section is empty.

Functions

func NewLoadAware

func NewLoadAware(args runtime.Object, handle types.Handle) (types.Plugin, error)

NewLoadAware builds plugin from its arguments while passing a handle

func SetDefaults_LoadAwareArgs

func SetDefaults_LoadAwareArgs(obj runtime.Object)

func ValidateLoadAwareArgs

func ValidateLoadAwareArgs(obj runtime.Object) error

Types

type LoadAware

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

func (*LoadAware) Balance

func (h *LoadAware) Balance(ctx context.Context, nodes []*v1.Node) *types.Status

Balance extension point implementation for the plugin

func (*LoadAware) Name

func (h *LoadAware) Name() string

Name retrieves the plugin name

type LoadAwareArgs

type LoadAwareArgs struct {
	metav1.TypeMeta `json:"inline"`

	UseDeviationThresholds bool                   `json:"useDeviationThresholds"`
	Thresholds             api.ResourceThresholds `json:"thresholds"`
	TargetThresholds       api.ResourceThresholds `json:"targetThresholds"`
	NumberOfNodes          int                    `json:"numberOfNodes"`

	// Naming this one differently since namespaces are still
	// considered while considering resources used by pods
	// but then filtered out before eviction
	EvictableNamespaces *api.Namespaces `json:"evictableNamespaces"`

	MetricsConfiguration Metrics `json:"metrics"`
}

func (*LoadAwareArgs) DeepCopy

func (in *LoadAwareArgs) DeepCopy() *LoadAwareArgs

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HighNodeUtilizationArgs.

func (*LoadAwareArgs) DeepCopyInto

func (in *LoadAwareArgs) DeepCopyInto(out *LoadAwareArgs)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LoadAwareArgs) DeepCopyObject

func (in *LoadAwareArgs) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type Metrics

type Metrics struct {
	Type     string `json:"type"`
	Address  string `json:"address"`
	Interval string `json:"interval"`
}

type MetricsClient

type MetricsClient interface {
	NodeMetricsAvg(ctx context.Context, nodeName string, period string) (*NodeMetrics, error)
}

func NewMetricsClient

func NewMetricsClient(metricsConf Metrics) (MetricsClient, error)

type NodeInfo

type NodeInfo struct {
	NodeUsage
}

type NodeMetrics

type NodeMetrics struct {
	CPU    float64
	Memory float64
}

type NodeThresholds

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

type NodeUsage

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

NodeUsage stores a node's info, pods on it, thresholds and its resource usage

type PrometheusMetricsClient

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

func NewPrometheusMetricsClient

func NewPrometheusMetricsClient(address string, conf Metrics) (*PrometheusMetricsClient, error)

func (*PrometheusMetricsClient) NodeMetricsAvg

func (p *PrometheusMetricsClient) NodeMetricsAvg(ctx context.Context, nodeName string, period string) (*NodeMetrics, error)

Jump to

Keyboard shortcuts

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