containermetadata

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

containermetadata provides functionality for retrieving the kubernetes pod and container metadata or the docker container metadata for a particular PID. For kubernetes it uses the shared informer from the k8s client-go API (https://github.com/kubernetes/client-go/blob/master/tools/cache/shared_informer.go). Through the shared informer we are notified of changes in the state of pods in the Kubernetes cluster and can add the pod container metadata to the cache. As a backup to the kubernetes shared informer and to find the docker container metadata for each pid received (if it is not already in the container caches), it will retrieve the container id from the /proc/PID/cgroup and retrieve the metadata for the containerID.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDeferred = errors.New("lookup deferred due to previous failure")
)

Functions

This section is empty.

Types

type ContainerMetadata

type ContainerMetadata struct {
	ContainerID   string
	EntityID      string
	PodName       string
	ContainerName string
}

ContainerMetadata contains the container and/or pod metadata.

type Provider

type Provider interface {
	GetContainerMetadata(pid libpf.PID) (ContainerMetadata, error)
}

Provider implementations support retrieving container metadata for a particular PID.

func NewContainerIDProvider added in v0.2.3

func NewContainerIDProvider() Provider

func NewContainerMetadataProvider

func NewContainerMetadataProvider(ctx context.Context, nodeName string) (
	Provider, error)

NewContainerMetadataProvider returns a new ContainerMetadataProvider instance used for retrieving container metadata.

Jump to

Keyboard shortcuts

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