Allocate is expected to be called during pod creation since allocation
failures for any container would result in pod startup failure.Allocate allows kubelet to exposes additional artifacts in a pod’s
environment as directed by the plugin.Allocate allows Device Plugin to run device specific operations on
the Devices requested
AllocateResponse includes the artifacts that needs to be injected into
a container for accessing ‘deviceIDs’ that were mentioned as part of
‘AllocateRequest’.
Failure Handling:
if Kubelet sends an allocation request for dev1 and dev2.
Allocation on dev1 succeeds but allocation on dev2 fails.
The Device plugin should send a ListAndWatch update and fail the
Allocation request
PreStartContainer is expected to be called before each container start if indicated by plugin during registration phase.PreStartContainer allows kubelet to pass reinitialized devices to containers.PreStartContainer allows Device Plugin to run device specific operations on
the Devices requested
PreferredAllocationRequest is passed via a call to GetPreferredAllocation()
at pod admission time. The device plugin should take the list of
available_deviceIDs and calculate a preferred allocation of size
‘allocation_size’ from them, making sure to include the set of devices
listed in ‘must_include_deviceIDs’.
The folder the Device Plugin is expecting sockets to be on. Only
privileged pods have access to this path. Note: Placeholder until we
find a “standard path”.
Avoid failed to run kubelet: bad socketPath, must be an absolute path:
/var/lib/kubelet/device-plugins/kubelet.sock
https://github.com/kubernetes/kubernetes/issues/93262
https://github.com/kubernetes/kubernetes/pull/93285#discussion_r458140701