kubernetes: k8s.io/kubernetes/pkg/kubelet/cadvisor Index | Files | Directories

package cadvisor

import "k8s.io/kubernetes/pkg/kubelet/cadvisor"

Package cadvisor provides an interface for Kubelet interactions with cAdvisor.

Index

Package Files

cadvisor_linux.go doc.go helpers_linux.go types.go util.go

Constants

const (
    // CrioSocket is the path to the CRI-O socket.
    // Please keep this in sync with the one in:
    // github.com/google/cadvisor/container/crio/client.go
    CrioSocket = "/var/run/crio/crio.sock"
)

func CapacityFromMachineInfo Uses

func CapacityFromMachineInfo(info *cadvisorapi.MachineInfo) v1.ResourceList

CapacityFromMachineInfo returns the capacity of the resources from the machine info.

func EphemeralStorageCapacityFromFsInfo Uses

func EphemeralStorageCapacityFromFsInfo(info cadvisorapi2.FsInfo) v1.ResourceList

EphemeralStorageCapacityFromFsInfo returns the capacity of the ephemeral storage from the FsInfo.

func UsingLegacyCadvisorStats Uses

func UsingLegacyCadvisorStats(runtime, runtimeEndpoint string) bool

UsingLegacyCadvisorStats returns true if container stats are provided by cadvisor instead of through the CRI. CRI integrations should get container metrics via CRI. Docker uses the built-in cadvisor to gather such metrics on Linux for historical reasons. cri-o relies on cadvisor as a temporary workaround. The code should be removed. Related issue: https://github.com/kubernetes/kubernetes/issues/51798

type ImageFsInfoProvider Uses

type ImageFsInfoProvider interface {
    // ImageFsInfoLabel returns the label cAdvisor should use to find the filesystem holding container images.
    ImageFsInfoLabel() (string, error)
}

ImageFsInfoProvider informs cAdvisor how to find imagefs for container images.

func NewImageFsInfoProvider Uses

func NewImageFsInfoProvider(runtime, runtimeEndpoint string) ImageFsInfoProvider

NewImageFsInfoProvider returns a provider for the specified runtime configuration.

type Interface Uses

type Interface interface {
    Start() error
    DockerContainer(name string, req *cadvisorapi.ContainerInfoRequest) (cadvisorapi.ContainerInfo, error)
    ContainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) (*cadvisorapi.ContainerInfo, error)
    ContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error)
    SubcontainerInfo(name string, req *cadvisorapi.ContainerInfoRequest) (map[string]*cadvisorapi.ContainerInfo, error)
    MachineInfo() (*cadvisorapi.MachineInfo, error)

    VersionInfo() (*cadvisorapi.VersionInfo, error)

    // Returns usage information about the filesystem holding container images.
    ImagesFsInfo() (cadvisorapiv2.FsInfo, error)

    // Returns usage information about the root filesystem.
    RootFsInfo() (cadvisorapiv2.FsInfo, error)

    // Get events streamed through passedChannel that fit the request.
    WatchEvents(request *events.Request) (*events.EventChannel, error)

    // Get filesystem information for the filesystem that contains the given file.
    GetDirFsInfo(path string) (cadvisorapiv2.FsInfo, error)
}

Interface is an abstract interface for testability. It abstracts the interface to cAdvisor.

func New Uses

func New(imageFsInfoProvider ImageFsInfoProvider, rootPath string, cgroupRoots []string, usingLegacyStats bool) (Interface, error)

New creates a new cAdvisor Interface for linux systems.

Directories

PathSynopsis
testing

Package cadvisor imports 27 packages (graph) and is imported by 651 packages. Updated 2019-09-12. Refresh now. Tools for package owners.