Documentation ¶
Index ¶
- Constants
- func NewStaticPolicy(agentCtx *agent.GenericContext, conf *config.Configuration, _ interface{}, ...) (bool, agent.Component, error)
- type StaticPolicy
- func (p *StaticPolicy) Allocate(_ context.Context, req *pluginapi.ResourceRequest) (resp *pluginapi.ResourceAllocationResponse, err error)
- 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, _ *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 ( // IOResourcePluginPolicyNameStatic is the policy name of static io resource plugin IOResourcePluginPolicyNameStatic = string(consts.ResourcePluginPolicyNameStatic) )
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 io policy
Types ¶
type StaticPolicy ¶
StaticPolicy is the static io 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) 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, _ *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