kubernetes: k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1alpha Index | Files

package deviceplugin

import "k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1alpha"

Index

Package Files

api.pb.go constants.go

Constants

const (
    // Healthy means that the device is healthy
    Healthy = "Healthy"
    // Unhealthy means that the device is unhealthy
    Unhealthy = "Unhealthy"

    // Version is the current version of the API supported by kubelet
    Version = "v1alpha2"
    // DevicePluginPath is 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"
    DevicePluginPath = "/var/lib/kubelet/device-plugins/"
    // KubeletSocket is the path of the Kubelet registry socket
    KubeletSocket = DevicePluginPath + "kubelet.sock"
)

Variables

var (
    ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowApi   = fmt.Errorf("proto: integer overflow")
)

func RegisterDevicePluginServer Uses

func RegisterDevicePluginServer(s *grpc.Server, srv DevicePluginServer)

func RegisterRegistrationServer Uses

func RegisterRegistrationServer(s *grpc.Server, srv RegistrationServer)

type AllocateRequest Uses

type AllocateRequest struct {
    DevicesIDs           []string `protobuf:"bytes,1,rep,name=devicesIDs,proto3" json:"devicesIDs,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

- 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

func (*AllocateRequest) Descriptor Uses

func (*AllocateRequest) Descriptor() ([]byte, []int)

func (*AllocateRequest) GetDevicesIDs Uses

func (m *AllocateRequest) GetDevicesIDs() []string

func (*AllocateRequest) Marshal Uses

func (m *AllocateRequest) Marshal() (dAtA []byte, err error)

func (*AllocateRequest) MarshalTo Uses

func (m *AllocateRequest) MarshalTo(dAtA []byte) (int, error)

func (*AllocateRequest) MarshalToSizedBuffer Uses

func (m *AllocateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AllocateRequest) ProtoMessage Uses

func (*AllocateRequest) ProtoMessage()

func (*AllocateRequest) Reset Uses

func (m *AllocateRequest) Reset()

func (*AllocateRequest) Size Uses

func (m *AllocateRequest) Size() (n int)

func (*AllocateRequest) String Uses

func (this *AllocateRequest) String() string

func (*AllocateRequest) Unmarshal Uses

func (m *AllocateRequest) Unmarshal(dAtA []byte) error

func (*AllocateRequest) XXX_DiscardUnknown Uses

func (m *AllocateRequest) XXX_DiscardUnknown()

func (*AllocateRequest) XXX_Marshal Uses

func (m *AllocateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AllocateRequest) XXX_Merge Uses

func (m *AllocateRequest) XXX_Merge(src proto.Message)

func (*AllocateRequest) XXX_Size Uses

func (m *AllocateRequest) XXX_Size() int

func (*AllocateRequest) XXX_Unmarshal Uses

func (m *AllocateRequest) XXX_Unmarshal(b []byte) error

type AllocateResponse Uses

type AllocateResponse struct {
    // List of environment variable to be set in the container to access one of more devices.
    Envs map[string]string `protobuf:"bytes,1,rep,name=envs,proto3" json:"envs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
    // Mounts for the container.
    Mounts []*Mount `protobuf:"bytes,2,rep,name=mounts,proto3" json:"mounts,omitempty"`
    // Devices for the container.
    Devices []*DeviceSpec `protobuf:"bytes,3,rep,name=devices,proto3" json:"devices,omitempty"`
    // Container annotations to pass to the container runtime
    Annotations          map[string]string `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
    XXX_NoUnkeyedLiteral struct{}          `json:"-"`
    XXX_sizecache        int32             `json:"-"`
}

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

func (*AllocateResponse) Descriptor Uses

func (*AllocateResponse) Descriptor() ([]byte, []int)

func (*AllocateResponse) GetAnnotations Uses

func (m *AllocateResponse) GetAnnotations() map[string]string

func (*AllocateResponse) GetDevices Uses

func (m *AllocateResponse) GetDevices() []*DeviceSpec

func (*AllocateResponse) GetEnvs Uses

func (m *AllocateResponse) GetEnvs() map[string]string

func (*AllocateResponse) GetMounts Uses

func (m *AllocateResponse) GetMounts() []*Mount

func (*AllocateResponse) Marshal Uses

func (m *AllocateResponse) Marshal() (dAtA []byte, err error)

func (*AllocateResponse) MarshalTo Uses

func (m *AllocateResponse) MarshalTo(dAtA []byte) (int, error)

func (*AllocateResponse) MarshalToSizedBuffer Uses

func (m *AllocateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AllocateResponse) ProtoMessage Uses

func (*AllocateResponse) ProtoMessage()

func (*AllocateResponse) Reset Uses

func (m *AllocateResponse) Reset()

func (*AllocateResponse) Size Uses

func (m *AllocateResponse) Size() (n int)

func (*AllocateResponse) String Uses

func (this *AllocateResponse) String() string

func (*AllocateResponse) Unmarshal Uses

func (m *AllocateResponse) Unmarshal(dAtA []byte) error

func (*AllocateResponse) XXX_DiscardUnknown Uses

func (m *AllocateResponse) XXX_DiscardUnknown()

func (*AllocateResponse) XXX_Marshal Uses

func (m *AllocateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AllocateResponse) XXX_Merge Uses

func (m *AllocateResponse) XXX_Merge(src proto.Message)

func (*AllocateResponse) XXX_Size Uses

func (m *AllocateResponse) XXX_Size() int

func (*AllocateResponse) XXX_Unmarshal Uses

func (m *AllocateResponse) XXX_Unmarshal(b []byte) error

type Device Uses

type Device struct {
    // A unique ID assigned by the device plugin used
    // to identify devices during the communication
    // Max length of this field is 63 characters
    ID  string `protobuf:"bytes,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
    // Health of the device, can be healthy or unhealthy, see constants.go
    Health               string   `protobuf:"bytes,2,opt,name=health,proto3" json:"health,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

E.g: struct Device {

ID: "GPU-fef8089b-4820-abfc-e83e-94318197576e",
State: "Healthy",

}

func (*Device) Descriptor Uses

func (*Device) Descriptor() ([]byte, []int)

func (*Device) GetHealth Uses

func (m *Device) GetHealth() string

func (*Device) GetID Uses

func (m *Device) GetID() string

func (*Device) Marshal Uses

func (m *Device) Marshal() (dAtA []byte, err error)

func (*Device) MarshalTo Uses

func (m *Device) MarshalTo(dAtA []byte) (int, error)

func (*Device) MarshalToSizedBuffer Uses

func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Device) ProtoMessage Uses

func (*Device) ProtoMessage()

func (*Device) Reset Uses

func (m *Device) Reset()

func (*Device) Size Uses

func (m *Device) Size() (n int)

func (*Device) String Uses

func (this *Device) String() string

func (*Device) Unmarshal Uses

func (m *Device) Unmarshal(dAtA []byte) error

func (*Device) XXX_DiscardUnknown Uses

func (m *Device) XXX_DiscardUnknown()

func (*Device) XXX_Marshal Uses

func (m *Device) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Device) XXX_Merge Uses

func (m *Device) XXX_Merge(src proto.Message)

func (*Device) XXX_Size Uses

func (m *Device) XXX_Size() int

func (*Device) XXX_Unmarshal Uses

func (m *Device) XXX_Unmarshal(b []byte) error

type DevicePluginClient Uses

type DevicePluginClient interface {
    // ListAndWatch returns a stream of List of Devices
    // Whenever a Device state changes or a Device disappears, ListAndWatch
    // returns the new list
    ListAndWatch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (DevicePlugin_ListAndWatchClient, 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
    Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error)
}

DevicePluginClient is the client API for DevicePlugin service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewDevicePluginClient Uses

func NewDevicePluginClient(cc *grpc.ClientConn) DevicePluginClient

type DevicePluginServer Uses

type DevicePluginServer interface {
    // ListAndWatch returns a stream of List of Devices
    // Whenever a Device state changes or a Device disappears, ListAndWatch
    // returns the new list
    ListAndWatch(*Empty, DevicePlugin_ListAndWatchServer) 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
    Allocate(context.Context, *AllocateRequest) (*AllocateResponse, error)
}

DevicePluginServer is the server API for DevicePlugin service.

type DevicePlugin_ListAndWatchClient Uses

type DevicePlugin_ListAndWatchClient interface {
    Recv() (*ListAndWatchResponse, error)
    grpc.ClientStream
}

type DevicePlugin_ListAndWatchServer Uses

type DevicePlugin_ListAndWatchServer interface {
    Send(*ListAndWatchResponse) error
    grpc.ServerStream
}

type DeviceSpec Uses

type DeviceSpec struct {
    // Path of the device within the container.
    ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"`
    // Path of the device on the host.
    HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"`
    // Cgroups permissions of the device, candidates are one or more of
    // * r - allows container to read from the specified device.
    // * w - allows container to write to the specified device.
    // * m - allows container to create device files that do not yet exist.
    Permissions          string   `protobuf:"bytes,3,opt,name=permissions,proto3" json:"permissions,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

DeviceSpec specifies a host device to mount into a container.

func (*DeviceSpec) Descriptor Uses

func (*DeviceSpec) Descriptor() ([]byte, []int)

func (*DeviceSpec) GetContainerPath Uses

func (m *DeviceSpec) GetContainerPath() string

func (*DeviceSpec) GetHostPath Uses

func (m *DeviceSpec) GetHostPath() string

func (*DeviceSpec) GetPermissions Uses

func (m *DeviceSpec) GetPermissions() string

func (*DeviceSpec) Marshal Uses

func (m *DeviceSpec) Marshal() (dAtA []byte, err error)

func (*DeviceSpec) MarshalTo Uses

func (m *DeviceSpec) MarshalTo(dAtA []byte) (int, error)

func (*DeviceSpec) MarshalToSizedBuffer Uses

func (m *DeviceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DeviceSpec) ProtoMessage Uses

func (*DeviceSpec) ProtoMessage()

func (*DeviceSpec) Reset Uses

func (m *DeviceSpec) Reset()

func (*DeviceSpec) Size Uses

func (m *DeviceSpec) Size() (n int)

func (*DeviceSpec) String Uses

func (this *DeviceSpec) String() string

func (*DeviceSpec) Unmarshal Uses

func (m *DeviceSpec) Unmarshal(dAtA []byte) error

func (*DeviceSpec) XXX_DiscardUnknown Uses

func (m *DeviceSpec) XXX_DiscardUnknown()

func (*DeviceSpec) XXX_Marshal Uses

func (m *DeviceSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeviceSpec) XXX_Merge Uses

func (m *DeviceSpec) XXX_Merge(src proto.Message)

func (*DeviceSpec) XXX_Size Uses

func (m *DeviceSpec) XXX_Size() int

func (*DeviceSpec) XXX_Unmarshal Uses

func (m *DeviceSpec) XXX_Unmarshal(b []byte) error

type Empty Uses

type Empty struct {
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*Empty) Descriptor Uses

func (*Empty) Descriptor() ([]byte, []int)

func (*Empty) Marshal Uses

func (m *Empty) Marshal() (dAtA []byte, err error)

func (*Empty) MarshalTo Uses

func (m *Empty) MarshalTo(dAtA []byte) (int, error)

func (*Empty) MarshalToSizedBuffer Uses

func (m *Empty) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Empty) ProtoMessage Uses

func (*Empty) ProtoMessage()

func (*Empty) Reset Uses

func (m *Empty) Reset()

func (*Empty) Size Uses

func (m *Empty) Size() (n int)

func (*Empty) String Uses

func (this *Empty) String() string

func (*Empty) Unmarshal Uses

func (m *Empty) Unmarshal(dAtA []byte) error

func (*Empty) XXX_DiscardUnknown Uses

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal Uses

func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Empty) XXX_Merge Uses

func (m *Empty) XXX_Merge(src proto.Message)

func (*Empty) XXX_Size Uses

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal Uses

func (m *Empty) XXX_Unmarshal(b []byte) error

type ListAndWatchResponse Uses

type ListAndWatchResponse struct {
    Devices              []*Device `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"`
    XXX_NoUnkeyedLiteral struct{}  `json:"-"`
    XXX_sizecache        int32     `json:"-"`
}

ListAndWatch returns a stream of List of Devices Whenever a Device state changes or a Device disappears, ListAndWatch returns the new list

func (*ListAndWatchResponse) Descriptor Uses

func (*ListAndWatchResponse) Descriptor() ([]byte, []int)

func (*ListAndWatchResponse) GetDevices Uses

func (m *ListAndWatchResponse) GetDevices() []*Device

func (*ListAndWatchResponse) Marshal Uses

func (m *ListAndWatchResponse) Marshal() (dAtA []byte, err error)

func (*ListAndWatchResponse) MarshalTo Uses

func (m *ListAndWatchResponse) MarshalTo(dAtA []byte) (int, error)

func (*ListAndWatchResponse) MarshalToSizedBuffer Uses

func (m *ListAndWatchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ListAndWatchResponse) ProtoMessage Uses

func (*ListAndWatchResponse) ProtoMessage()

func (*ListAndWatchResponse) Reset Uses

func (m *ListAndWatchResponse) Reset()

func (*ListAndWatchResponse) Size Uses

func (m *ListAndWatchResponse) Size() (n int)

func (*ListAndWatchResponse) String Uses

func (this *ListAndWatchResponse) String() string

func (*ListAndWatchResponse) Unmarshal Uses

func (m *ListAndWatchResponse) Unmarshal(dAtA []byte) error

func (*ListAndWatchResponse) XXX_DiscardUnknown Uses

func (m *ListAndWatchResponse) XXX_DiscardUnknown()

func (*ListAndWatchResponse) XXX_Marshal Uses

func (m *ListAndWatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListAndWatchResponse) XXX_Merge Uses

func (m *ListAndWatchResponse) XXX_Merge(src proto.Message)

func (*ListAndWatchResponse) XXX_Size Uses

func (m *ListAndWatchResponse) XXX_Size() int

func (*ListAndWatchResponse) XXX_Unmarshal Uses

func (m *ListAndWatchResponse) XXX_Unmarshal(b []byte) error

type Mount Uses

type Mount struct {
    // Path of the mount within the container.
    ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"`
    // Path of the mount on the host.
    HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"`
    // If set, the mount is read-only.
    ReadOnly             bool     `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

Mount specifies a host volume to mount into a container. where device library or tools are installed on host and container

func (*Mount) Descriptor Uses

func (*Mount) Descriptor() ([]byte, []int)

func (*Mount) GetContainerPath Uses

func (m *Mount) GetContainerPath() string

func (*Mount) GetHostPath Uses

func (m *Mount) GetHostPath() string

func (*Mount) GetReadOnly Uses

func (m *Mount) GetReadOnly() bool

func (*Mount) Marshal Uses

func (m *Mount) Marshal() (dAtA []byte, err error)

func (*Mount) MarshalTo Uses

func (m *Mount) MarshalTo(dAtA []byte) (int, error)

func (*Mount) MarshalToSizedBuffer Uses

func (m *Mount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Mount) ProtoMessage Uses

func (*Mount) ProtoMessage()

func (*Mount) Reset Uses

func (m *Mount) Reset()

func (*Mount) Size Uses

func (m *Mount) Size() (n int)

func (*Mount) String Uses

func (this *Mount) String() string

func (*Mount) Unmarshal Uses

func (m *Mount) Unmarshal(dAtA []byte) error

func (*Mount) XXX_DiscardUnknown Uses

func (m *Mount) XXX_DiscardUnknown()

func (*Mount) XXX_Marshal Uses

func (m *Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Mount) XXX_Merge Uses

func (m *Mount) XXX_Merge(src proto.Message)

func (*Mount) XXX_Size Uses

func (m *Mount) XXX_Size() int

func (*Mount) XXX_Unmarshal Uses

func (m *Mount) XXX_Unmarshal(b []byte) error

type RegisterRequest Uses

type RegisterRequest struct {
    // Version of the API the Device Plugin was built against
    Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
    // Name of the unix socket the device plugin is listening on
    // PATH = path.Join(DevicePluginPath, endpoint)
    Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
    // Schedulable resource name. As of now it's expected to be a DNS Label
    ResourceName         string   `protobuf:"bytes,3,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*RegisterRequest) Descriptor Uses

func (*RegisterRequest) Descriptor() ([]byte, []int)

func (*RegisterRequest) GetEndpoint Uses

func (m *RegisterRequest) GetEndpoint() string

func (*RegisterRequest) GetResourceName Uses

func (m *RegisterRequest) GetResourceName() string

func (*RegisterRequest) GetVersion Uses

func (m *RegisterRequest) GetVersion() string

func (*RegisterRequest) Marshal Uses

func (m *RegisterRequest) Marshal() (dAtA []byte, err error)

func (*RegisterRequest) MarshalTo Uses

func (m *RegisterRequest) MarshalTo(dAtA []byte) (int, error)

func (*RegisterRequest) MarshalToSizedBuffer Uses

func (m *RegisterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RegisterRequest) ProtoMessage Uses

func (*RegisterRequest) ProtoMessage()

func (*RegisterRequest) Reset Uses

func (m *RegisterRequest) Reset()

func (*RegisterRequest) Size Uses

func (m *RegisterRequest) Size() (n int)

func (*RegisterRequest) String Uses

func (this *RegisterRequest) String() string

func (*RegisterRequest) Unmarshal Uses

func (m *RegisterRequest) Unmarshal(dAtA []byte) error

func (*RegisterRequest) XXX_DiscardUnknown Uses

func (m *RegisterRequest) XXX_DiscardUnknown()

func (*RegisterRequest) XXX_Marshal Uses

func (m *RegisterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RegisterRequest) XXX_Merge Uses

func (m *RegisterRequest) XXX_Merge(src proto.Message)

func (*RegisterRequest) XXX_Size Uses

func (m *RegisterRequest) XXX_Size() int

func (*RegisterRequest) XXX_Unmarshal Uses

func (m *RegisterRequest) XXX_Unmarshal(b []byte) error

type RegistrationClient Uses

type RegistrationClient interface {
    Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*Empty, error)
}

RegistrationClient is the client API for Registration service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRegistrationClient Uses

func NewRegistrationClient(cc *grpc.ClientConn) RegistrationClient

type RegistrationServer Uses

type RegistrationServer interface {
    Register(context.Context, *RegisterRequest) (*Empty, error)
}

RegistrationServer is the server API for Registration service.

type UnimplementedDevicePluginServer Uses

type UnimplementedDevicePluginServer struct {
}

UnimplementedDevicePluginServer can be embedded to have forward compatible implementations.

func (*UnimplementedDevicePluginServer) Allocate Uses

func (*UnimplementedDevicePluginServer) Allocate(ctx context.Context, req *AllocateRequest) (*AllocateResponse, error)

func (*UnimplementedDevicePluginServer) ListAndWatch Uses

func (*UnimplementedDevicePluginServer) ListAndWatch(req *Empty, srv DevicePlugin_ListAndWatchServer) error

type UnimplementedRegistrationServer Uses

type UnimplementedRegistrationServer struct {
}

UnimplementedRegistrationServer can be embedded to have forward compatible implementations.

func (*UnimplementedRegistrationServer) Register Uses

func (*UnimplementedRegistrationServer) Register(ctx context.Context, req *RegisterRequest) (*Empty, error)

Package deviceplugin imports 13 packages (graph) and is imported by 6 packages. Updated 2019-07-26. Refresh now. Tools for package owners.