podresapi

package
v0.15.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	HintProvider = "podresourceapi:"
)

Variables

This section is empty.

Functions

func IsPodResourceHint added in v0.10.0

func IsPodResourceHint(provider string) bool

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is Pod Resources API client.

func NewClient

func NewClient(options ...ClientOption) (*Client, error)

NewClient creates a new Pod Resources API client with the given options.

func (*Client) Close

func (c *Client) Close()

Close closes the client.

func (*Client) Get

func (c *Client) Get(ctx context.Context, namespace, pod string) (*PodResources, error)

Get queries the given pod's resources.

func (*Client) HasClient

func (c *Client) HasClient() bool

HasClient returns true if the client has a usable client.

func (*Client) List

func (c *Client) List(ctx context.Context) (*PodResourcesList, error)

List lists all pods' resources.

func (*Client) PurgePodResources added in v0.9.4

func (c *Client) PurgePodResources(namespace, pod string)

PurgePodResources removes any cached resources for the given pod.

type ClientOption

type ClientOption func(*Client)

ClientOption is an option for the client.

func WithClientConn

func WithClientConn(conn *grpc.ClientConn) ClientOption

WithClientConn sets a pre-created gRPC connection for the client.

func WithSocketPath

func WithSocketPath(path string) ClientOption

WithSocketPath sets the kubelet socket path to connect to.

type ContainerResources

type ContainerResources struct {
	*api.ContainerResources
}

ContainerResources contains resources for a single container.

func (*ContainerResources) GetDeviceTopologyHints

func (r *ContainerResources) GetDeviceTopologyHints(checkDenied func(string) bool) topology.Hints

GetDeviceTopologyHints returns topology hints for the given container. checkDenied is used to filter out hints that are disallowed.

type PodResources

type PodResources struct {
	*api.PodResources
}

PodResources contains resources for a pod.

func (*PodResources) GetContainer

func (p *PodResources) GetContainer(ctr string) *ContainerResources

GetContainer returns resources for the given container.

type PodResourcesList

type PodResourcesList struct {
	// contains filtered or unexported fields
}

PodResourcesList containers the result of a pod resources list query.

func NewPodResourcesList

func NewPodResourcesList(l []*api.PodResources) *PodResourcesList

func (*PodResourcesList) GetContainer

func (l *PodResourcesList) GetContainer(ns, pod, ctr string) *ContainerResources

GetContainer returns resources for the given container.

func (*PodResourcesList) GetPodResources

func (l *PodResourcesList) GetPodResources(ns, pod string) *PodResources

GetPodResources returns resources for the given pod.

func (*PodResourcesList) Len

func (l *PodResourcesList) Len() int

func (*PodResourcesList) PurgePodResources added in v0.9.4

func (l *PodResourcesList) PurgePodResources(ns, pod string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL