Documentation ¶
Index ¶
- Constants
- func NewStaticPolicy(agentCtx *agent.GenericContext, conf *config.Configuration, _ interface{}, ...) (bool, agent.Component, error)
- type NICFilter
- type NICSelectionPoligy
- type ReservationPolicy
- type StaticPolicy
- func (p *StaticPolicy) Allocate(_ context.Context, req *pluginapi.ResourceRequest) (resp *pluginapi.ResourceAllocationResponse, err error)
- func (p *StaticPolicy) ApplyConfig(conf *agentconfig.StaticAgentConfiguration)
- func (p *StaticPolicy) GetResourcePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.ResourcePluginOptions, error)
- func (p *StaticPolicy) GetResourcesAllocation(_ context.Context, _ *pluginapi.GetResourcesAllocationRequest) (*pluginapi.GetResourcesAllocationResponse, error)
- func (p *StaticPolicy) GetTopologyAwareAllocatableResources(_ context.Context, _ *pluginapi.GetTopologyAwareAllocatableResourcesRequest) (*pluginapi.GetTopologyAwareAllocatableResourcesResponse, error)
- func (p *StaticPolicy) GetTopologyAwareResources(_ context.Context, req *pluginapi.GetTopologyAwareResourcesRequest) (*pluginapi.GetTopologyAwareResourcesResponse, error)
- func (p *StaticPolicy) GetTopologyHints(_ context.Context, req *pluginapi.ResourceRequest) (resp *pluginapi.ResourceHintsResponse, err error)
- func (p *StaticPolicy) Name() string
- func (p *StaticPolicy) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (p *StaticPolicy) RemovePod(_ context.Context, req *pluginapi.RemovePodRequest) (*pluginapi.RemovePodResponse, error)
- func (p *StaticPolicy) ResourceName() string
- func (p *StaticPolicy) Start() (err error)
- func (p *StaticPolicy) Stop() error
Constants ¶
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 = "," )
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 ¶
StaticPolicy is the static network policy
func (*StaticPolicy) Allocate ¶
func (p *StaticPolicy) Allocate(_ context.Context, req *pluginapi.ResourceRequest, ) (resp *pluginapi.ResourceAllocationResponse, err error)
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 ¶
func (p *StaticPolicy) GetResourcesAllocation(_ context.Context, _ *pluginapi.GetResourcesAllocationRequest, ) (*pluginapi.GetResourcesAllocationResponse, error)
GetResourcesAllocation returns allocation results of corresponding resources
func (*StaticPolicy) GetTopologyAwareAllocatableResources ¶
func (p *StaticPolicy) GetTopologyAwareAllocatableResources(_ context.Context, _ *pluginapi.GetTopologyAwareAllocatableResourcesRequest, ) (*pluginapi.GetTopologyAwareAllocatableResourcesResponse, error)
GetTopologyAwareAllocatableResources returns corresponding allocatable resources as topology aware format
func (*StaticPolicy) GetTopologyAwareResources ¶
func (p *StaticPolicy) GetTopologyAwareResources(_ context.Context, req *pluginapi.GetTopologyAwareResourcesRequest, ) (*pluginapi.GetTopologyAwareResourcesResponse, error)
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 ¶
func (p *StaticPolicy) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest, ) (*pluginapi.PreStartContainerResponse, error)
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 (p *StaticPolicy) RemovePod(_ context.Context, req *pluginapi.RemovePodRequest, ) (*pluginapi.RemovePodResponse, error)
func (*StaticPolicy) ResourceName ¶
func (p *StaticPolicy) ResourceName() string
ResourceName returns resource names managed by this plugin