Documentation
¶
Overview ¶
Package deviceplugin provides functions to start a device plugin service
Package deviceplugin provides functions to start a device plugin service
Index ¶
- type AttestationType
- type CcDevice
- type CcDevicePlugin
- func (cdp *CcDevicePlugin) Allocate(_ context.Context, req *v1beta1.AllocateRequest) (*v1beta1.AllocateResponse, error)
- func (cdp *CcDevicePlugin) GetDevicePluginOptions(_ context.Context, _ *v1beta1.Empty) (*v1beta1.DevicePluginOptions, error)
- func (cdp *CcDevicePlugin) GetPreferredAllocation(context.Context, *v1beta1.PreferredAllocationRequest) (*v1beta1.PreferredAllocationResponse, error)
- func (cdp *CcDevicePlugin) ListAndWatch(_ *v1beta1.Empty, stream v1beta1.DevicePlugin_ListAndWatchServer) error
- func (cdp *CcDevicePlugin) PreStartContainer(_ context.Context, _ *v1beta1.PreStartContainerRequest) (*v1beta1.PreStartContainerResponse, error)
- type CcDeviceSpec
- type Plugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttestationType ¶ added in v1.1.0
type AttestationType string
AttestationType defines if the attestation is based on software emulation or hardware.
const ( SoftwareAttestation AttestationType = "software" // e.g., vTPM HardwareAttestation AttestationType = "hardware" // e.g., Intel TDX, AMD SEV-SNP )
type CcDevice ¶
CcDevice wraps the v1.beta1.Device type, which has hostPath, containerPath and permission
type CcDevicePlugin ¶
type CcDevicePlugin struct {
// contains filtered or unexported fields
}
CcDevicePlugin is a device plugin for cc devices
func (*CcDevicePlugin) Allocate ¶
func (cdp *CcDevicePlugin) Allocate(_ context.Context, req *v1beta1.AllocateRequest) (*v1beta1.AllocateResponse, error)
Allocate assigns cc devices to a Pod.
func (*CcDevicePlugin) GetDevicePluginOptions ¶
func (cdp *CcDevicePlugin) GetDevicePluginOptions(_ context.Context, _ *v1beta1.Empty) (*v1beta1.DevicePluginOptions, error)
GetDevicePluginOptions returns options to be communicated with Device Manager. Currently it always returns an empty response until plugin options are implemented.
func (*CcDevicePlugin) GetPreferredAllocation ¶
func (cdp *CcDevicePlugin) GetPreferredAllocation(context.Context, *v1beta1.PreferredAllocationRequest) (*v1beta1.PreferredAllocationResponse, error)
GetPreferredAllocation returns a preferred set of devices to allocate from a list of available ones. It is only designed to help the devicemanager make a more informed allocation decision when possible. It is not needed for cc device plugin, thus always returns an empty response.
func (*CcDevicePlugin) ListAndWatch ¶
func (cdp *CcDevicePlugin) ListAndWatch(_ *v1beta1.Empty, stream v1beta1.DevicePlugin_ListAndWatchServer) error
ListAndWatch lists all devices and then refreshes every deviceCheckInterval.
func (*CcDevicePlugin) PreStartContainer ¶
func (cdp *CcDevicePlugin) PreStartContainer(_ context.Context, _ *v1beta1.PreStartContainerRequest) (*v1beta1.PreStartContainerResponse, error)
PreStartContainer is called, if indicated by Device Plugin during registration phase, before each container start. Device plugin can run device specific operations such as resetting the device before making devices available to the container. It is not needed for cc device plugin, thus always returns an empty response.
type CcDeviceSpec ¶
type CcDeviceSpec struct {
Resource string
DevicePaths []string
MeasurementPaths []string
DeviceLimit int // Number of allocatable instances of this resource
Type AttestationType // New flag to explicitly define the device type
}
CcDeviceSpec defines a cc device type and the paths at which it can be found.
type Plugin ¶
type Plugin interface {
v1beta1.DevicePluginServer
Run(context.Context) error
}
Plugin is a Kubernetes device plugin that can be run.
func NewCcDevicePlugin ¶
func NewCcDevicePlugin(cds *CcDeviceSpec, devicePluginPath string, socket string, logger log.Logger, reg prometheus.Registerer) (Plugin, error)
NewCcDevicePlugin creates a new plugin for a cc device.
func NewPlugin ¶
func NewPlugin(resource, devicePluginPath string, socket string, kubeSocketBase string, dps v1beta1.DevicePluginServer, logger log.Logger, reg prometheus.Registerer) Plugin
NewPlugin creates a new instance of a device plugin.