staticpolicy

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// NetworkResourcePluginPolicyNameStatic is the policy name of static network resource plugin
	NetworkResourcePluginPolicyNameStatic = string(apiconsts.ResourcePluginPolicyNameStatic)

	NetworkPluginStateFileName = "network_plugin_state"

	// IPsSeparator is used to split merged IPs string
	IPsSeparator = ","
)
View Source
const (
	FirstNIC         ReservationPolicy = "first"
	EvenDistribution ReservationPolicy = "even"

	RandomOne NICSelectionPoligy = "random"
	FirstOne  NICSelectionPoligy = "first"
	LastOne   NICSelectionPoligy = "last"
)

Variables

This section is empty.

Functions

func NewStaticPolicy

func NewStaticPolicy(agentCtx *agent.GenericContext, conf *config.Configuration,
	_ interface{}, agentName string,
) (bool, agent.Component, error)

NewStaticPolicy returns a static network policy

Types

type NICFilter

type NICFilter func(nics []machine.InterfaceInfo, req *pluginapi.ResourceRequest, agentCtx *agent.GenericContext) []machine.InterfaceInfo

type NICSelectionPoligy added in v0.3.0

type NICSelectionPoligy string

type ReservationPolicy added in v0.3.0

type ReservationPolicy string

type StaticPolicy

type StaticPolicy struct {
	sync.Mutex

	CgroupV2Env bool
	// contains filtered or unexported fields
}

StaticPolicy is the static network policy

func (*StaticPolicy) Allocate

Allocate is called during pod admit so that the resource plugin can allocate corresponding resource for the container according to resource request

func (*StaticPolicy) ApplyConfig

func (p *StaticPolicy) ApplyConfig(conf *agentconfig.StaticAgentConfiguration)

ApplyConfig applies config to StaticPolicy

func (*StaticPolicy) GetResourcePluginOptions

func (p *StaticPolicy) GetResourcePluginOptions(context.Context,
	*pluginapi.Empty,
) (*pluginapi.ResourcePluginOptions, error)

GetResourcePluginOptions returns options to be communicated with Resource Manager

func (*StaticPolicy) GetResourcesAllocation

GetResourcesAllocation returns allocation results of corresponding resources

func (*StaticPolicy) GetTopologyAwareAllocatableResources

GetTopologyAwareAllocatableResources returns corresponding allocatable resources as topology aware format

func (*StaticPolicy) GetTopologyAwareResources

GetTopologyAwareResources returns allocation results of corresponding resources as topology aware format

func (*StaticPolicy) GetTopologyHints

func (p *StaticPolicy) GetTopologyHints(_ context.Context,
	req *pluginapi.ResourceRequest,
) (resp *pluginapi.ResourceHintsResponse, err error)

GetTopologyHints returns hints of corresponding resources

func (*StaticPolicy) Name

func (p *StaticPolicy) Name() string

Name returns the name of this plugin

func (*StaticPolicy) PreStartContainer

PreStartContainer is called, if indicated by resource plugin during registration phase, before each container start. Resource plugin can run resource specific operations such as resetting the resource before making resources available to the container

func (*StaticPolicy) RemovePod

func (*StaticPolicy) ResourceName

func (p *StaticPolicy) ResourceName() string

ResourceName returns resource names managed by this plugin

func (*StaticPolicy) Start

func (p *StaticPolicy) Start() (err error)

Start starts this plugin

func (*StaticPolicy) Stop

func (p *StaticPolicy) Stop() error

Stop stops this plugin

Jump to

Keyboard shortcuts

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