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 ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerMetadata ¶
type ContainerMetadata struct { PodName string ContainerName string // contains filtered or unexported fields }
ContainerMetadata contains the container and/or pod metadata.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler does the retrieval of container metadata for a particular pid.
func GetHandler ¶
GetHandler returns a new Handler instance used for retrieving container metadata.
func (*Handler) GetContainerMetadata ¶
func (h *Handler) GetContainerMetadata(pid libpf.PID) (ContainerMetadata, error)
GetContainerMetadata returns the pod name and container name metadata associated with the provided pid. Returns an empty object if no container metadata exists.