Documentation ¶
Index ¶
- Constants
- func UnixDial(addr string, timeout time.Duration) (net.Conn, error)
- type MultusNicServer
- func (s *MultusNicServer) Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (s *MultusNicServer) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (s *MultusNicServer) GetPreferredAllocation(ctx context.Context, req *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
- func (s *MultusNicServer) ListAndWatch(e *pluginapi.Empty, srv pluginapi.DevicePlugin_ListAndWatchServer) error
- func (s *MultusNicServer) PreStartContainer(ctx context.Context, req *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (s *MultusNicServer) RegisterToKubelet() error
- func (s *MultusNicServer) Run() error
Constants ¶
const ( // KubeletSocket kubelet 监听 unix 的名称 KubeletSocket string = "kubelet.sock" // DevicePluginPath 默认位置 DevicePluginPath string = "/var/lib/kubelet/device-plugins/" TotalDevicesCount int = 40 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MultusNicServer ¶
type MultusNicServer struct {
// contains filtered or unexported fields
}
MultusNicServer 是一个 device plugin server
func NewMultusNicServer ¶
func NewMultusNicServer() *MultusNicServer
NewMultusNicServer 实例化 MultusNicServer
func (*MultusNicServer) Allocate ¶
func (s *MultusNicServer) Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
Allocate is called during container creation so that the Device Plugin can run device specific operations and instruct Kubelet of the steps to make the Device available in the container
func (*MultusNicServer) GetDevicePluginOptions ¶
func (s *MultusNicServer) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
GetDevicePluginOptions returns options to be communicated with Device Manager
func (*MultusNicServer) GetPreferredAllocation ¶
func (s *MultusNicServer) GetPreferredAllocation(ctx context.Context, req *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
GetPreferredAllocation
func (*MultusNicServer) ListAndWatch ¶
func (s *MultusNicServer) ListAndWatch(e *pluginapi.Empty, srv pluginapi.DevicePlugin_ListAndWatchServer) error
ListAndWatch returns a stream of List of Devices Whenever a Device state change or a Device disappears, ListAndWatch returns the new list
func (*MultusNicServer) PreStartContainer ¶
func (s *MultusNicServer) PreStartContainer(ctx context.Context, req *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
PreStartContainer is called, if indicated by Device Plugin during registeration phase, before each container start. Device plugin can run device specific operations such as reseting the device before making devices available to the container
func (*MultusNicServer) RegisterToKubelet ¶
func (s *MultusNicServer) RegisterToKubelet() error
RegisterToKubelet 向kubelet注册device plugin