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 ¶
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