Documentation ¶
Index ¶
- Constants
- func Abs(r framework.Resource) framework.Resource
- func ComputePodRequest(pod v1.Pod) v1.ResourceList
- func FromFrameworkToList(r framework.Resource) v1.ResourceList
- func FromListToFramework(r v1.ResourceList) framework.Resource
- func NewPodResourcesListerClient(timeout time.Duration, maxMsgSize int) (pdrv1.PodResourcesListerClient, error)
- func Subtract(r1 framework.Resource, r2 framework.Resource) framework.Resource
- func SubtractNonNegative(r1 framework.Resource, r2 framework.Resource) framework.Resource
- func Sum(r1 framework.Resource, r2 framework.Resource) framework.Resource
- type Calculator
- type Client
- type Device
- type Status
Constants ¶
View Source
const (
// PodResourcesPath is the path to the local endpoint serving the PodResources GRPC service.
PodResourcesPath = "/var/lib/kubelet/pod-resources"
)
Variables ¶
This section is empty.
Functions ¶
func ComputePodRequest ¶
func ComputePodRequest(pod v1.Pod) v1.ResourceList
func FromFrameworkToList ¶
func FromFrameworkToList(r framework.Resource) v1.ResourceList
FromFrameworkToList converts the input scheduler framework.Resource to a core v1.ResourceList
func FromListToFramework ¶
func FromListToFramework(r v1.ResourceList) framework.Resource
FromListToFramework converts the input core v1.ResourceList to a scheduler framework.Resource
func Subtract ¶
Subtract returns a new resource corresponding to the result of r1 - r2. The returned resource contains the union of the scalar resources of r1 and r2.
func SubtractNonNegative ¶
SubtractNonNegative returns a new resource corresponding to the result of Max(0, r1 - r2). The returned resource contains the union of the scalar resources of r1 and r2.
Types ¶
type Calculator ¶
type Calculator interface {
ComputePodRequest(pod v1.Pod) v1.ResourceList
}
type Client ¶
type Client interface { GetAllocatableDevices(ctx context.Context) ([]Device, error) GetUsedDevices(ctx context.Context) ([]Device, error) }
func NewClient ¶
func NewClient(lister pdrv1.PodResourcesListerClient) Client
type Device ¶
type Device struct { // ResourceName is the name of the resource exposed to k8s // (e.g. nvidia.com/gpu, nvidia.com/mig-2g10gb, etc.) ResourceName v1.ResourceName // DeviceId is the actual ID of the underlying device // (e.g. ID of the GPU, ID of the MIG device, etc.) DeviceId string // Status represents the status of the k8s resource (e.g. free or used) Status Status }
func (Device) IsNvidiaResource ¶
Click to show internal directories.
Click to hide internal directories.