runtime

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PodNameLabel       = "io.kubernetes.pod.name"
	PodNamespaceLabel  = "io.kubernetes.pod.namespace"
	PodUIDLabel        = "io.kubernetes.pod.uid"
	ContainerNameLabel = "io.kubernetes.container.name"
)

These labels are injected by kubelet on container creation, we can use them to gather additional data in a k8s context

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerEnricher

type ContainerEnricher interface {
	Get(containerId string, ctx context.Context) (ContainerMetadata, error)
}

func ContainerdEnricher

func ContainerdEnricher(socket string) (ContainerEnricher, error)

func CrioEnricher

func CrioEnricher(socket string) (ContainerEnricher, error)

func DockerEnricher

func DockerEnricher(socket string) (ContainerEnricher, error)

type ContainerMetadata

type ContainerMetadata struct {
	ContainerId string
	Name        string
	Image       string
	Pod         PodMetadata
}

type PodMetadata

type PodMetadata struct {
	Name      string
	Namespace string
	UID       string
}

type RuntimeId

type RuntimeId int

Represents the internal ID of a container runtime

const (
	Unknown RuntimeId = iota
	Docker
	Containerd
	Crio
	Podman
)

func FromString added in v0.8.2

func FromString(str string) RuntimeId

func (RuntimeId) String

func (runtime RuntimeId) String() string

type Sockets

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

Sockets represent existing container runtime connections

func Autodiscover added in v0.8.2

func Autodiscover(onRegisterFail func(err error, runtime RuntimeId, socket string)) Sockets

check default paths for all supported container runtimes and aggregate them

func (*Sockets) Register

func (s *Sockets) Register(runtime RuntimeId, socket string) error

Register attempts to associate a file path with a container runtime, if the path doens't exist registration will fail

func (*Sockets) Socket

func (s *Sockets) Socket(runtime RuntimeId) string

Socket returns the relevant socket for the runtime if one was registered

func (*Sockets) Supports

func (s *Sockets) Supports(runtime RuntimeId) bool

Supports check if the runtime was registered in the Sockets struct

Jump to

Keyboard shortcuts

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