kube

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InfoForPID = container.InfoForPID

InfoForPID is an injectable dependency for system-independent testing

Functions

func TopOwner added in v1.9.0

func TopOwner(pod *informer.PodInfo) *informer.Owner

TopOwner assumes that the owners slice as returned by the informers' cache library, is sorted from lower-level to upper-level, so the last owner will be the top owner (e.g. the Deployment that owns the ReplicaSet that owns a Pod).

Types

type MetaSourceLabels added in v1.9.0

type MetaSourceLabels struct {
	ServiceName      string `yaml:"service_name" env:"BEYLA_KUBE_META_SOURCE_LABEL_SERVICE_NAME"`
	ServiceNamespace string `yaml:"service_namespace" env:"BEYLA_KUBE_META_SOURCE_LABEL_SERVICE_NAMESPACE"`
}

MetaSourceLabels allow overriding some metadata from kubernetes labels

type MetadataConfig added in v1.9.0

type MetadataConfig struct {
	Enable            kubeflags.EnableFlag
	DisabledInformers []string
	KubeConfigPath    string
	SyncTimeout       time.Duration
	ResyncPeriod      time.Duration
	MetaCacheAddr     string
	MetaSourceLabels  MetaSourceLabels
}

type MetadataProvider added in v1.7.0

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

func NewMetadataProvider added in v1.7.0

func NewMetadataProvider(config MetadataConfig) *MetadataProvider

func (*MetadataProvider) CurrentNodeName added in v1.9.0

func (mp *MetadataProvider) CurrentNodeName(ctx context.Context) (string, error)

func (*MetadataProvider) ForceDisable added in v1.7.0

func (mp *MetadataProvider) ForceDisable()

func (*MetadataProvider) Get added in v1.7.0

func (mp *MetadataProvider) Get(ctx context.Context) (*Store, error)

func (*MetadataProvider) IsKubeEnabled added in v1.7.0

func (mp *MetadataProvider) IsKubeEnabled() bool

func (*MetadataProvider) KubeClient added in v1.7.0

func (mp *MetadataProvider) KubeClient() (kubernetes.Interface, error)

type OTelServiceNamePair added in v1.9.0

type OTelServiceNamePair struct {
	Name      string
	Namespace string
}

type Store added in v1.9.0

type Store struct {

	// Instead of subscribing to the informer directly, the rest of components
	// will subscribe to this store, to make sure that any "new object" notification
	// they receive is already present in the store
	meta.BaseNotifier
	// contains filtered or unexported fields
}

Store aggregates Kubernetes information from multiple sources: - the informer that keep an indexed copy of the existing pods and replicasets. - the inspected container.Info objects, indexed either by container ID and PID namespace - a cache of decorated PodInfo that would avoid reconstructing them on each trace decoration

func NewStore added in v1.9.0

func NewStore(kubeMetadata meta.Notifier, sourceLabels MetaSourceLabels) *Store

func (*Store) AddProcess added in v1.9.0

func (s *Store) AddProcess(pid uint32)

func (*Store) DeleteProcess added in v1.9.0

func (s *Store) DeleteProcess(pid uint32)

func (*Store) ID added in v1.9.0

func (s *Store) ID() string

func (*Store) ObjectMetaByIP added in v1.9.0

func (s *Store) ObjectMetaByIP(ip string) *informer.ObjectMeta

func (*Store) On added in v1.9.0

func (s *Store) On(event *informer.Event) error

On is invoked by the informer when a new Kube object is created, updated or deleted. It will forward the notification to all the Store subscribers

func (*Store) PodByContainerID added in v1.9.0

func (s *Store) PodByContainerID(cid string) *informer.ObjectMeta

func (*Store) PodContainerByPIDNs added in v1.9.0

func (s *Store) PodContainerByPIDNs(pidns uint32) (*informer.ObjectMeta, string)

PodContainerByPIDNs second return value: container Name

func (*Store) ServiceNameNamespaceForIP added in v1.9.0

func (s *Store) ServiceNameNamespaceForIP(ip string) (string, string)

ServiceNameNamespaceForIP returns the service name and namespace for a given IP address This means that, for a given Pod, we will not return the Pod Name, but the Pod Owner Name

func (*Store) ServiceNameNamespaceForMetadata added in v1.9.0

func (s *Store) ServiceNameNamespaceForMetadata(om *informer.ObjectMeta) (string, string)

func (*Store) Subscribe added in v1.9.0

func (s *Store) Subscribe(observer meta.Observer)

Subscribe overrides BaseNotifier to send a "welcome message" to each new observer containing the whole metadata store

Jump to

Keyboard shortcuts

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