manager

package
v1.13.4 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CgroupManager

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

CgroupManager maintains Kubernetes and low-level metadata (cgroup path and cgroup id) for local pods and their containers. In order to do that, it defines and implements callback functions that are called on Kubernetes pod watcher events. It also exposes APIs to read the saved metadata.

The manager's internals are synchronized via a channel, and must not be accessed/updated outside this channel.

During initialization, the manager checks for a valid cgroup path pathProvider. If it fails to find a pathProvider, it will ignore all the subsequent pod events.

func NewCgroupManager

func NewCgroupManager() *CgroupManager

NewCgroupManager returns an initialized version of CgroupManager.

func (*CgroupManager) Close

func (m *CgroupManager) Close()

Close should only be called once from daemon close.

func (*CgroupManager) DumpPodMetadata

func (m *CgroupManager) DumpPodMetadata() []*FullPodMetadata

func (*CgroupManager) GetPodMetadataForContainer

func (m *CgroupManager) GetPodMetadataForContainer(cgroupId uint64) *PodMetadata

GetPodMetadataForContainer returns pod metadata for the given container cgroup id in case of success, or nil otherwise.

func (*CgroupManager) OnAddPod

func (m *CgroupManager) OnAddPod(pod *v1.Pod)

func (*CgroupManager) OnDeletePod

func (m *CgroupManager) OnDeletePod(pod *v1.Pod)

func (*CgroupManager) OnUpdatePod

func (m *CgroupManager) OnUpdatePod(oldPod, newPod *v1.Pod)

type FullPodMetadata

type FullPodMetadata struct {
	Name       string
	Namespace  string
	Containers []*cgroupMetadata
	IPs        []string
}

FullPodMetadata stores selected metadata of a pod and associated containers.

type PodMetadata

type PodMetadata struct {
	Name      string
	Namespace string
	IPs       []string
}

PodMetadata stores selected metadata of a pod populated via Kubernetes watcher events.

Jump to

Keyboard shortcuts

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