metadata

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 33 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")
)
View Source
var ErrFileParse = errors.New("Error Parsing File")

Functions

func GetControllerOf

func GetControllerOf(controllee v1.Object) *v1.OwnerReference

GetControllerOf returns a pointer to a copy of the controllerRef if controllee has a controller https://github.com/kubernetes/apimachinery/blob/cd2cae2b39fa57e8063fa1f5f13cfe9862db3d41/pkg/apis/meta/v1/controller_ref.go

Types

type ExecInfo

type ExecInfo struct {
	FileName string
	BuildID  string
	Compiler string
	Static   bool
	Stripped bool
}

ExecInfo enriches an executable with additional metadata.

type MetadataProvider

type MetadataProvider interface {
	// AddMetadata adds metadata to the provided labels.Builder for the given PID.
	// It returns whether the metadata can be safely cached.
	AddMetadata(pid libpf.PID, lb *labels.Builder) bool
}

MetadataProvider implementations support adding metadata to a labels.Builder.

func NewAgentMetadataProvider

func NewAgentMetadataProvider(revision string) MetadataProvider

func NewContainerMetadataProvider

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

NewContainerMetadataProvider creates a new container metadata provider.

func NewMainExecutableMetadataProvider

func NewMainExecutableMetadataProvider(
	executableCache *lru.SyncedLRU[libpf.FileID, ExecInfo],
) MetadataProvider

NewMainExecutableMetadataProvider creates a new mainExecutableMetadataProvider.

func NewProcessMetadataProvider

func NewProcessMetadataProvider() MetadataProvider

NewProcessMetadataProvider creates a new processMetadataProvider.

func NewSystemMetadataProvider

func NewSystemMetadataProvider() (MetadataProvider, error)

type Role

type Role string

Role is role of the service in Kubernetes.

const (
	RolePod  Role = "pod"
	RoleNode Role = "node"
)

The valid options for Role.

Jump to

Keyboard shortcuts

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