Documentation ¶
Index ¶
- Constants
- func GetReadonlyState() (state.ReadonlyState, error)
- func NewDynamicPolicy(agentCtx *agent.GenericContext, conf *config.Configuration, _ interface{}, ...) (bool, agent.Component, error)
- type DynamicPolicy
- func (p *DynamicPolicy) Allocate(ctx context.Context, req *pluginapi.ResourceRequest) (resp *pluginapi.ResourceAllocationResponse, respErr error)
- func (p *DynamicPolicy) ApplyConfig(conf *config.DynamicConfiguration)
- func (p *DynamicPolicy) GetCheckpoint(ctx context.Context, req *advisorapi.GetCheckpointRequest) (*advisorapi.GetCheckpointResponse, error)
- func (p *DynamicPolicy) GetResourcePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.ResourcePluginOptions, error)
- func (p *DynamicPolicy) GetResourcesAllocation(ctx context.Context, req *pluginapi.GetResourcesAllocationRequest) (*pluginapi.GetResourcesAllocationResponse, error)
- func (p *DynamicPolicy) GetTopologyAwareAllocatableResources(ctx context.Context, ...) (*pluginapi.GetTopologyAwareAllocatableResourcesResponse, error)
- func (p *DynamicPolicy) GetTopologyAwareResources(ctx context.Context, req *pluginapi.GetTopologyAwareResourcesRequest) (*pluginapi.GetTopologyAwareResourcesResponse, error)
- func (p *DynamicPolicy) GetTopologyHints(ctx context.Context, req *pluginapi.ResourceRequest) (resp *pluginapi.ResourceHintsResponse, err error)
- func (p *DynamicPolicy) Name() string
- func (p *DynamicPolicy) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (p *DynamicPolicy) ReclaimDisabled(poolsCPUSet map[string]machine.CPUSet, reclaimedCPUs machine.CPUSet) machine.CPUSet
- func (p *DynamicPolicy) RemovePod(ctx context.Context, req *pluginapi.RemovePodRequest) (resp *pluginapi.RemovePodResponse, err error)
- func (p *DynamicPolicy) ResourceName() string
- func (p *DynamicPolicy) Start() (err error)
- func (p *DynamicPolicy) Stop() error
Constants ¶
const (
CPUResourcePluginPolicyNameDynamic = "dynamic"
)
Variables ¶
This section is empty.
Functions ¶
func GetReadonlyState ¶
func GetReadonlyState() (state.ReadonlyState, error)
func NewDynamicPolicy ¶
func NewDynamicPolicy(agentCtx *agent.GenericContext, conf *config.Configuration, _ interface{}, agentName string) (bool, agent.Component, error)
Types ¶
type DynamicPolicy ¶
type DynamicPolicy struct { advisorapi.UnimplementedCPUPluginServer sync.RWMutex // contains filtered or unexported fields }
DynamicPolicy is the policy that's used by default; it will consider the dynamic running information to calculate and adjust resource requirements and configurations
func (*DynamicPolicy) Allocate ¶
func (p *DynamicPolicy) 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 (*DynamicPolicy) ApplyConfig ¶
func (p *DynamicPolicy) ApplyConfig(conf *config.DynamicConfiguration)
func (*DynamicPolicy) GetCheckpoint ¶
func (p *DynamicPolicy) GetCheckpoint(ctx context.Context, req *advisorapi.GetCheckpointRequest) (*advisorapi.GetCheckpointResponse, error)
func (*DynamicPolicy) GetResourcePluginOptions ¶
func (p *DynamicPolicy) GetResourcePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.ResourcePluginOptions, error)
GetResourcePluginOptions returns options to be communicated with Resource Manager
func (*DynamicPolicy) GetResourcesAllocation ¶
func (p *DynamicPolicy) GetResourcesAllocation(ctx context.Context, req *pluginapi.GetResourcesAllocationRequest) (*pluginapi.GetResourcesAllocationResponse, error)
GetResourcesAllocation returns allocation results of corresponding resources
func (*DynamicPolicy) GetTopologyAwareAllocatableResources ¶
func (p *DynamicPolicy) GetTopologyAwareAllocatableResources(ctx context.Context, req *pluginapi.GetTopologyAwareAllocatableResourcesRequest) (*pluginapi.GetTopologyAwareAllocatableResourcesResponse, error)
GetTopologyAwareAllocatableResources returns corresponding allocatable resources as machineInfo aware format
func (*DynamicPolicy) GetTopologyAwareResources ¶
func (p *DynamicPolicy) GetTopologyAwareResources(ctx context.Context, req *pluginapi.GetTopologyAwareResourcesRequest) (*pluginapi.GetTopologyAwareResourcesResponse, error)
GetTopologyAwareResources returns allocation results of corresponding resources as machineInfo aware format
func (*DynamicPolicy) GetTopologyHints ¶
func (p *DynamicPolicy) GetTopologyHints(ctx context.Context, req *pluginapi.ResourceRequest) (resp *pluginapi.ResourceHintsResponse, err error)
GetTopologyHints returns hints of corresponding resources
func (*DynamicPolicy) Name ¶
func (p *DynamicPolicy) Name() string
func (*DynamicPolicy) PreStartContainer ¶
func (p *DynamicPolicy) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
PreStartContainer is called, if indicated by resource plugin during registeration 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 (*DynamicPolicy) ReclaimDisabled ¶
func (p *DynamicPolicy) ReclaimDisabled(poolsCPUSet map[string]machine.CPUSet, reclaimedCPUs machine.CPUSet) machine.CPUSet
ReclaimDisabled tries to allocate reclaimed cores to none-reclaimed pools, if we disable reclaim on current node. this could be used a down-grade strategy to disable reclaimed workloads in emergency
func (*DynamicPolicy) RemovePod ¶
func (p *DynamicPolicy) RemovePod(ctx context.Context, req *pluginapi.RemovePodRequest) (resp *pluginapi.RemovePodResponse, err error)
func (*DynamicPolicy) ResourceName ¶
func (p *DynamicPolicy) ResourceName() string
func (*DynamicPolicy) Start ¶
func (p *DynamicPolicy) Start() (err error)
func (*DynamicPolicy) Stop ¶
func (p *DynamicPolicy) Stop() error