Documentation ¶
Index ¶
- type Config
- type DevicePlugin
- type HealthyDevicePlugin
- func (m *HealthyDevicePlugin) Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (m *HealthyDevicePlugin) GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (m *HealthyDevicePlugin) GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
- func (m *HealthyDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
- func (m *HealthyDevicePlugin) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (m *HealthyDevicePlugin) Register() error
- func (m *HealthyDevicePlugin) Serve() error
- func (m *HealthyDevicePlugin) Start() error
- func (m *HealthyDevicePlugin) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { BandWidth bool `json:"bandWidth"` CpuIdleTime bool `json:"cpuIdleTime"` CpuRequest bool `json:"cpuRequest"` DProcessNum bool `json:"dProcessNum"` DeviceIo bool `json:"deviceIo"` FileDescriptor bool `json:"fileDescriptor"` FreeMemory bool `json:"freeMemory"` Load5 bool `json:"load5"` MemRequest bool `json:"memRequest"` MountpointInode bool `json:"mountpointInode"` MountpointStorage bool `json:"mountpointStorage"` PodNum bool `json:"podNum"` ProcessNum bool `json:"processNum"` ZProcessNum bool `json:"zProcessNum"` }
Config 结构用于映射配置文件中的字段
type DevicePlugin ¶
type DevicePlugin interface { Start() error Stop() error Serve() error Register() error GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error) Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error) }
type HealthyDevicePlugin ¶
type HealthyDevicePlugin struct {
// contains filtered or unexported fields
}
HealthyDevicePlugin implements the Kubernetes device plugin API
func NewHealthyDevicePlugin ¶
func NewHealthyDevicePlugin(resourceName string, socket string) *HealthyDevicePlugin
NewHealthyDevicePlugin returns an initialized HealthyDevicePlugin
func (*HealthyDevicePlugin) Allocate ¶
func (m *HealthyDevicePlugin) Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
Allocate which return list of devices.
func (*HealthyDevicePlugin) GetDevicePluginOptions ¶
func (m *HealthyDevicePlugin) GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
GetDevicePluginOptions returns the values of the optional settings for this plugin
func (*HealthyDevicePlugin) GetPreferredAllocation ¶
func (m *HealthyDevicePlugin) GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
GetPreferredAllocation returns the preferred allocation from the set of devices specified in the request
func (*HealthyDevicePlugin) ListAndWatch ¶
func (m *HealthyDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
ListAndWatch lists devices and update that list according to the health status
func (*HealthyDevicePlugin) PreStartContainer ¶
func (m *HealthyDevicePlugin) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
PreStartContainer is unimplemented for this plugin
func (*HealthyDevicePlugin) Register ¶
func (m *HealthyDevicePlugin) Register() error
Register registers the device plugin for the given resourceName with Kubelet.
func (*HealthyDevicePlugin) Serve ¶
func (m *HealthyDevicePlugin) Serve() error
Serve starts the gRPC server of the device plugin.
func (*HealthyDevicePlugin) Start ¶
func (m *HealthyDevicePlugin) Start() error
Start starts the gRPC server, registers the device plugin with the Kubelet, and starts the device healthchecks.
func (*HealthyDevicePlugin) Stop ¶
func (m *HealthyDevicePlugin) Stop() error
Stop stops the gRPC server.