Documentation ¶
Index ¶
- Constants
- func GetReadonlyState() (state.ReadonlyState, error)
- func NewNativePolicy(agentCtx *agent.GenericContext, conf *config.Configuration, _ interface{}, ...) (bool, agent.Component, error)
- type NativePolicy
- func (p *NativePolicy) Allocate(ctx context.Context, req *pluginapi.ResourceRequest) (resp *pluginapi.ResourceAllocationResponse, respErr error)
- func (p *NativePolicy) AllocateForPod(ctx context.Context, req *pluginapi.PodResourceRequest) (resp *pluginapi.PodResourceAllocationResponse, respErr error)
- func (p *NativePolicy) GetPodTopologyHints(ctx context.Context, req *pluginapi.PodResourceRequest) (resp *pluginapi.PodResourceHintsResponse, err error)
- func (p *NativePolicy) GetResourcePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.ResourcePluginOptions, error)
- func (p *NativePolicy) GetResourcesAllocation(_ context.Context, req *pluginapi.GetResourcesAllocationRequest) (*pluginapi.GetResourcesAllocationResponse, error)
- func (p *NativePolicy) GetTopologyAwareAllocatableResources(_ context.Context, _ *pluginapi.GetTopologyAwareAllocatableResourcesRequest) (*pluginapi.GetTopologyAwareAllocatableResourcesResponse, error)
- func (p *NativePolicy) GetTopologyAwareResources(_ context.Context, req *pluginapi.GetTopologyAwareResourcesRequest) (*pluginapi.GetTopologyAwareResourcesResponse, error)
- func (p *NativePolicy) GetTopologyHints(ctx context.Context, req *pluginapi.ResourceRequest) (resp *pluginapi.ResourceHintsResponse, err error)
- func (p *NativePolicy) Name() string
- func (p *NativePolicy) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (p *NativePolicy) RemovePod(ctx context.Context, req *pluginapi.RemovePodRequest) (resp *pluginapi.RemovePodResponse, err error)
- func (p *NativePolicy) ResourceName() string
- func (p *NativePolicy) Start() (err error)
- func (p *NativePolicy) Stop() error
- type SMTAlignmentError
Constants ¶
const (
// ErrorSMTAlignment represents the type of an SMTAlignmentError.
ErrorSMTAlignment = "SMTAlignmentError"
)
Variables ¶
This section is empty.
Functions ¶
func GetReadonlyState ¶
func GetReadonlyState() (state.ReadonlyState, error)
GetReadonlyState returns state.ReadonlyState to provides a way to obtain the running states of the plugin
func NewNativePolicy ¶
func NewNativePolicy(agentCtx *agent.GenericContext, conf *config.Configuration, _ interface{}, agentName string, ) (bool, agent.Component, error)
Types ¶
type NativePolicy ¶
NativePolicy is a policy compatible with Kubernetes native semantics and is used in topology-aware scheduling scenarios.
func (*NativePolicy) Allocate ¶
func (p *NativePolicy) Allocate(ctx context.Context, req *pluginapi.ResourceRequest, ) (resp *pluginapi.ResourceAllocationResponse, respErr error)
Allocate is called during pod admit so that the resource plugin can allocate corresponding resource for the container according to resource request
func (*NativePolicy) AllocateForPod ¶ added in v0.5.8
func (p *NativePolicy) AllocateForPod(ctx context.Context, req *pluginapi.PodResourceRequest, ) (resp *pluginapi.PodResourceAllocationResponse, respErr error)
AllocateForPod is called during pod admit so that the resource plugin can allocate corresponding resource for the pod according to resource request
func (*NativePolicy) GetPodTopologyHints ¶ added in v0.5.8
func (p *NativePolicy) GetPodTopologyHints(ctx context.Context, req *pluginapi.PodResourceRequest, ) (resp *pluginapi.PodResourceHintsResponse, err error)
GetPodTopologyHints returns hints of corresponding resources for pod
func (*NativePolicy) GetResourcePluginOptions ¶
func (p *NativePolicy) GetResourcePluginOptions(context.Context, *pluginapi.Empty, ) (*pluginapi.ResourcePluginOptions, error)
GetResourcePluginOptions returns options to be communicated with Resource Manager
func (*NativePolicy) GetResourcesAllocation ¶
func (p *NativePolicy) GetResourcesAllocation(_ context.Context, req *pluginapi.GetResourcesAllocationRequest, ) (*pluginapi.GetResourcesAllocationResponse, error)
GetResourcesAllocation returns allocation results of corresponding resources
func (*NativePolicy) GetTopologyAwareAllocatableResources ¶
func (p *NativePolicy) GetTopologyAwareAllocatableResources(_ context.Context, _ *pluginapi.GetTopologyAwareAllocatableResourcesRequest, ) (*pluginapi.GetTopologyAwareAllocatableResourcesResponse, error)
GetTopologyAwareAllocatableResources returns corresponding allocatable resources as machineInfo aware format
func (*NativePolicy) GetTopologyAwareResources ¶
func (p *NativePolicy) GetTopologyAwareResources(_ context.Context, req *pluginapi.GetTopologyAwareResourcesRequest, ) (*pluginapi.GetTopologyAwareResourcesResponse, error)
GetTopologyAwareResources returns allocation results of corresponding resources as machineInfo aware format
func (*NativePolicy) GetTopologyHints ¶
func (p *NativePolicy) GetTopologyHints(ctx context.Context, req *pluginapi.ResourceRequest, ) (resp *pluginapi.ResourceHintsResponse, err error)
GetTopologyHints returns hints of corresponding resources
func (*NativePolicy) Name ¶
func (p *NativePolicy) Name() string
func (*NativePolicy) PreStartContainer ¶
func (p *NativePolicy) 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 (*NativePolicy) RemovePod ¶
func (p *NativePolicy) RemovePod(ctx context.Context, req *pluginapi.RemovePodRequest, ) (resp *pluginapi.RemovePodResponse, err error)
func (*NativePolicy) ResourceName ¶
func (p *NativePolicy) ResourceName() string
func (*NativePolicy) Start ¶
func (p *NativePolicy) Start() (err error)
func (*NativePolicy) Stop ¶
func (p *NativePolicy) Stop() error
type SMTAlignmentError ¶
SMTAlignmentError represents an error due to SMT alignment
func (SMTAlignmentError) Error ¶
func (e SMTAlignmentError) Error() string
func (SMTAlignmentError) Type ¶
func (e SMTAlignmentError) Type() string