containers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Inspector Inspector

	Display      string // Friendly Name
	Name         string // container name
	ID           string // container sha/id
	Digest       string // Container Digest
	Image        string
	PodName      string
	Sandbox      string
	Status       string // Running state of container
	RestartCount string
	LogPath      string
	Metrics      *ContainerMetrics
	Pid          uint32
	IsPodSandbox bool // real container or just pod sandbox
}

Container presents information about a container

func (*Container) GetLogChunker

func (c *Container) GetLogChunker(follow bool, tailLines int) (chunker.Chunker, io.Closer, error)

GetLogChunker returns chunker for container log file

func (*Container) GetLogFile

func (c *Container) GetLogFile() string

GetLogFile returns path to log file, k8s-style

func (*Container) GetProcessStderr

func (c *Container) GetProcessStderr() (string, error)

GetProcessStderr returns process stderr

func (*Container) Kill

func (c *Container) Kill(signal syscall.Signal) error

Kill sends signal to container task

type ContainerMetrics added in v0.2.0

type ContainerMetrics struct {
	MemoryUsage uint64
	CPUUsage    uint64
}

ContainerMetrics represents container cgroup stats

type Inspector

type Inspector interface {
	// Pods collects information about running pods & containers.
	Pods() ([]*Pod, error)
	// Container returns info about a single container.
	Container(id string) (*Container, error)
	// Images returns a hash of image digest -> name.
	Images() (map[string]string, error)
	// Close frees associated resources.
	Close() error
	// Returns path to the container's stderr pipe
	GetProcessStderr(ID string) (string, error)
	// Kill sends signal to container's process
	Kill(ID string, isPodSandbox bool, signal syscall.Signal) error
}

Inspector gather information about pods & containers

type Pod

type Pod struct {
	Name    string
	Sandbox string

	Containers []*Container
}

Pod presents information about a pod, including a list of containers

Directories

Path Synopsis
Package containerd implements containers.Inspector via containerd API
Package containerd implements containers.Inspector via containerd API
cri
Package cri implements containers.Inspector via CRI
Package cri implements containers.Inspector via CRI
containerd
Package containerd provides support for containerd CRI plugin
Package containerd provides support for containerd CRI plugin

Jump to

Keyboard shortcuts

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