Documentation ¶
Index ¶
- type Endpoint
- type EndpointImpl
- func (e *EndpointImpl) Allocate(c context.Context, resourceRequest *pluginapi.ResourceRequest) (*pluginapi.ResourceAllocationResponse, error)
- func (e *EndpointImpl) AllocateForPod(c context.Context, resourceRequest *pluginapi.PodResourceRequest) (*pluginapi.PodResourceAllocationResponse, error)
- func (e *EndpointImpl) Client() pluginapi.ResourcePluginClient
- func (e *EndpointImpl) GetPodTopologyHints(c context.Context, resourceRequest *pluginapi.PodResourceRequest) (*pluginapi.PodResourceHintsResponse, error)
- func (e *EndpointImpl) GetResourceAllocation(c context.Context, request *pluginapi.GetResourcesAllocationRequest) (*pluginapi.GetResourcesAllocationResponse, error)
- func (e *EndpointImpl) GetResourcePluginOptions(ctx context.Context, in *pluginapi.Empty, opts ...grpc.CallOption) (*pluginapi.ResourcePluginOptions, error)
- func (e *EndpointImpl) GetTopologyAwareAllocatableResources(c context.Context, ...) (*pluginapi.GetTopologyAwareAllocatableResourcesResponse, error)
- func (e *EndpointImpl) GetTopologyAwareResources(c context.Context, request *pluginapi.GetTopologyAwareResourcesRequest) (*pluginapi.GetTopologyAwareResourcesResponse, error)
- func (e *EndpointImpl) GetTopologyHints(c context.Context, resourceRequest *pluginapi.ResourceRequest) (*pluginapi.ResourceHintsResponse, error)
- func (e *EndpointImpl) IsStopped() bool
- func (e *EndpointImpl) RemovePod(c context.Context, removePodRequest *pluginapi.RemovePodRequest) (*pluginapi.RemovePodResponse, error)
- func (e *EndpointImpl) Stop()
- func (e *EndpointImpl) StopGracePeriodExpired() bool
- type EndpointInfo
- type Stub
- func (m *Stub) Allocate(ctx context.Context, r *pluginapi.ResourceRequest) (*pluginapi.ResourceAllocationResponse, error)
- func (m *Stub) AllocateForPod(ctx context.Context, r *pluginapi.PodResourceRequest) (*pluginapi.PodResourceAllocationResponse, error)
- func (m *Stub) GetInfo(ctx context.Context, req *watcherapi.InfoRequest) (*watcherapi.PluginInfo, error)
- func (m *Stub) GetPodTopologyHints(ctx context.Context, r *pluginapi.PodResourceRequest) (*pluginapi.PodResourceHintsResponse, error)
- func (m *Stub) GetResourcePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.ResourcePluginOptions, error)
- func (m *Stub) GetResourcesAllocation(ctx context.Context, r *pluginapi.GetResourcesAllocationRequest) (*pluginapi.GetResourcesAllocationResponse, error)
- func (m *Stub) GetTopologyAwareAllocatableResources(ctx context.Context, r *pluginapi.GetTopologyAwareAllocatableResourcesRequest) (*pluginapi.GetTopologyAwareAllocatableResourcesResponse, error)
- func (m *Stub) GetTopologyAwareResources(ctx context.Context, r *pluginapi.GetTopologyAwareResourcesRequest) (*pluginapi.GetTopologyAwareResourcesResponse, error)
- func (m *Stub) GetTopologyHints(ctx context.Context, r *pluginapi.ResourceRequest) (*pluginapi.ResourceHintsResponse, error)
- func (m *Stub) NotifyRegistrationStatus(ctx context.Context, status *watcherapi.RegistrationStatus) (*watcherapi.RegistrationStatusResponse, error)
- func (m *Stub) PreStartContainer(ctx context.Context, r *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (m *Stub) Register(kubeletEndpoint, resourceName string, pluginSockDir string) error
- func (m *Stub) RemovePod(ctx context.Context, r *pluginapi.RemovePodRequest) (*pluginapi.RemovePodResponse, error)
- func (m *Stub) SetAllocFunc(f stubAllocFunc1)
- func (m *Stub) SetGetAllocFunc(f stubAllocFunc2)
- func (m *Stub) SetGetTopologyAwareAllocatableResourcesFunc(f stubGetTopologyAwareAllocatableResourcesFunc)
- func (m *Stub) SetGetTopologyAwareResourcesFunc(f stubGetTopologyAwareResourcesFunc)
- func (m *Stub) Start() error
- func (m *Stub) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint interface { Stop() Allocate(c context.Context, resourceRequest *pluginapi.ResourceRequest) (*pluginapi.ResourceAllocationResponse, error) AllocateForPod(c context.Context, resourceRequest *pluginapi.PodResourceRequest) (*pluginapi.PodResourceAllocationResponse, error) GetTopologyHints(c context.Context, resourceRequest *pluginapi.ResourceRequest) (*pluginapi.ResourceHintsResponse, error) GetPodTopologyHints(c context.Context, resourceRequest *pluginapi.PodResourceRequest) (*pluginapi.PodResourceHintsResponse, error) GetResourceAllocation(c context.Context, request *pluginapi.GetResourcesAllocationRequest) (*pluginapi.GetResourcesAllocationResponse, error) RemovePod(c context.Context, removePodRequest *pluginapi.RemovePodRequest) (*pluginapi.RemovePodResponse, error) IsStopped() bool StopGracePeriodExpired() bool GetResourcePluginOptions(ctx context.Context, in *pluginapi.Empty, opts ...grpc.CallOption) (*pluginapi.ResourcePluginOptions, error) GetTopologyAwareAllocatableResources(c context.Context, request *pluginapi.GetTopologyAwareAllocatableResourcesRequest) (*pluginapi.GetTopologyAwareAllocatableResourcesResponse, error) GetTopologyAwareResources(c context.Context, request *pluginapi.GetTopologyAwareResourcesRequest) (*pluginapi.GetTopologyAwareResourcesResponse, error) }
Endpoint maps to a single registered resource plugin. It is responsible for managing gRPC communications with the resource plugin and caching resource states reported by the resource plugin.
type EndpointImpl ¶
type EndpointImpl struct {
// contains filtered or unexported fields
}
func NewEndpointImpl ¶
func NewEndpointImpl(socketPath, resourceName string) (*EndpointImpl, error)
NewEndpointImpl creates a new endpoint for the given resourceName. This is to be used during normal resource plugin registration.
func NewStoppedEndpointImpl ¶
func NewStoppedEndpointImpl(resourceName string) *EndpointImpl
NewStoppedEndpointImpl creates a new endpoint for the given resourceName with stopTime set. This is to be used during Kubelet restart, before the actual resource plugin re-registers.
func (*EndpointImpl) Allocate ¶
func (e *EndpointImpl) Allocate(c context.Context, resourceRequest *pluginapi.ResourceRequest) (*pluginapi.ResourceAllocationResponse, error)
allocate issues Allocate gRPC call to the resource plugin.
func (*EndpointImpl) AllocateForPod ¶ added in v0.5.8
func (e *EndpointImpl) AllocateForPod(c context.Context, resourceRequest *pluginapi.PodResourceRequest) (*pluginapi.PodResourceAllocationResponse, error)
func (*EndpointImpl) Client ¶
func (e *EndpointImpl) Client() pluginapi.ResourcePluginClient
func (*EndpointImpl) GetPodTopologyHints ¶ added in v0.5.8
func (e *EndpointImpl) GetPodTopologyHints(c context.Context, resourceRequest *pluginapi.PodResourceRequest) (*pluginapi.PodResourceHintsResponse, error)
func (*EndpointImpl) GetResourceAllocation ¶
func (e *EndpointImpl) GetResourceAllocation(c context.Context, request *pluginapi.GetResourcesAllocationRequest) (*pluginapi.GetResourcesAllocationResponse, error)
func (*EndpointImpl) GetResourcePluginOptions ¶
func (e *EndpointImpl) GetResourcePluginOptions(ctx context.Context, in *pluginapi.Empty, opts ...grpc.CallOption) (*pluginapi.ResourcePluginOptions, error)
func (*EndpointImpl) GetTopologyAwareAllocatableResources ¶ added in v0.4.2
func (e *EndpointImpl) GetTopologyAwareAllocatableResources(c context.Context, request *pluginapi.GetTopologyAwareAllocatableResourcesRequest) (*pluginapi.GetTopologyAwareAllocatableResourcesResponse, error)
func (*EndpointImpl) GetTopologyAwareResources ¶ added in v0.4.2
func (e *EndpointImpl) GetTopologyAwareResources(c context.Context, request *pluginapi.GetTopologyAwareResourcesRequest) (*pluginapi.GetTopologyAwareResourcesResponse, error)
func (*EndpointImpl) GetTopologyHints ¶
func (e *EndpointImpl) GetTopologyHints(c context.Context, resourceRequest *pluginapi.ResourceRequest) (*pluginapi.ResourceHintsResponse, error)
func (*EndpointImpl) IsStopped ¶
func (e *EndpointImpl) IsStopped() bool
func (*EndpointImpl) RemovePod ¶
func (e *EndpointImpl) RemovePod(c context.Context, removePodRequest *pluginapi.RemovePodRequest) (*pluginapi.RemovePodResponse, error)
func (*EndpointImpl) Stop ¶
func (e *EndpointImpl) Stop()
func (*EndpointImpl) StopGracePeriodExpired ¶
func (e *EndpointImpl) StopGracePeriodExpired() bool
type EndpointInfo ¶
type EndpointInfo struct { E Endpoint Opts *pluginapi.ResourcePluginOptions }
type Stub ¶
type Stub struct {
// contains filtered or unexported fields
}
func NewResourcePluginStub ¶
NewResourcePluginStub returns an initialized ResourcePlugin Stub.
func (*Stub) Allocate ¶
func (m *Stub) Allocate(ctx context.Context, r *pluginapi.ResourceRequest) (*pluginapi.ResourceAllocationResponse, error)
Allocate does a mock allocation
func (*Stub) AllocateForPod ¶ added in v0.5.8
func (m *Stub) AllocateForPod(ctx context.Context, r *pluginapi.PodResourceRequest) (*pluginapi.PodResourceAllocationResponse, error)
AllocateForPod does a mock allocation for pod
func (*Stub) GetInfo ¶
func (m *Stub) GetInfo(ctx context.Context, req *watcherapi.InfoRequest) (*watcherapi.PluginInfo, error)
GetInfo is the RPC which return pluginInfo
func (*Stub) GetPodTopologyHints ¶ added in v0.5.8
func (m *Stub) GetPodTopologyHints(ctx context.Context, r *pluginapi.PodResourceRequest) (*pluginapi.PodResourceHintsResponse, error)
GetPodTopologyHints returns hints of corresponding resources
func (*Stub) GetResourcePluginOptions ¶
func (m *Stub) GetResourcePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.ResourcePluginOptions, error)
GetResourcePluginOptions returns ResourcePluginOptions settings for the resource plugin.
func (*Stub) GetResourcesAllocation ¶
func (m *Stub) GetResourcesAllocation(ctx context.Context, r *pluginapi.GetResourcesAllocationRequest) (*pluginapi.GetResourcesAllocationResponse, error)
GetResourcesAllocation returns allocation results of corresponding resources
func (*Stub) GetTopologyAwareAllocatableResources ¶
func (m *Stub) GetTopologyAwareAllocatableResources(ctx context.Context, r *pluginapi.GetTopologyAwareAllocatableResourcesRequest) (*pluginapi.GetTopologyAwareAllocatableResourcesResponse, error)
GetTopologyAwareResources returns corresponding allocatable resources as topology aware format
func (*Stub) GetTopologyAwareResources ¶
func (m *Stub) GetTopologyAwareResources(ctx context.Context, r *pluginapi.GetTopologyAwareResourcesRequest) (*pluginapi.GetTopologyAwareResourcesResponse, error)
GetTopologyAwareResources returns allocation results of corresponding resources as topology aware format
func (*Stub) GetTopologyHints ¶
func (m *Stub) GetTopologyHints(ctx context.Context, r *pluginapi.ResourceRequest) (*pluginapi.ResourceHintsResponse, error)
GetTopologyHints returns hints of corresponding resources
func (*Stub) NotifyRegistrationStatus ¶
func (m *Stub) NotifyRegistrationStatus(ctx context.Context, status *watcherapi.RegistrationStatus) (*watcherapi.RegistrationStatusResponse, error)
NotifyRegistrationStatus receives the registration notification from watcher
func (*Stub) PreStartContainer ¶
func (m *Stub) PreStartContainer(ctx context.Context, r *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
PreStartContainer resets the resources received
func (*Stub) Register ¶
Register registers the resource plugin for the given resourceName with Kubelet.
func (*Stub) RemovePod ¶
func (m *Stub) RemovePod(ctx context.Context, r *pluginapi.RemovePodRequest) (*pluginapi.RemovePodResponse, error)
Notify the resource plugin that the pod has beed deleted, and the plugin should do some clear-up work.
func (*Stub) SetAllocFunc ¶
func (m *Stub) SetAllocFunc(f stubAllocFunc1)
SetAllocFunc sets allocFunc of the resource plugin
func (*Stub) SetGetAllocFunc ¶
func (m *Stub) SetGetAllocFunc(f stubAllocFunc2)
func (*Stub) SetGetTopologyAwareAllocatableResourcesFunc ¶ added in v0.4.2
func (m *Stub) SetGetTopologyAwareAllocatableResourcesFunc(f stubGetTopologyAwareAllocatableResourcesFunc)
func (*Stub) SetGetTopologyAwareResourcesFunc ¶ added in v0.4.2
func (m *Stub) SetGetTopologyAwareResourcesFunc(f stubGetTopologyAwareResourcesFunc)