Documentation ¶
Index ¶
- type CgroupManager
- func (m *CgroupManager) Close()
- func (m *CgroupManager) DumpPodMetadata() []*FullPodMetadata
- func (m *CgroupManager) GetPodMetadataForContainer(cgroupId uint64) *PodMetadata
- func (m *CgroupManager) OnAddPod(pod *v1.Pod)
- func (m *CgroupManager) OnDeletePod(pod *v1.Pod)
- func (m *CgroupManager) OnUpdatePod(oldPod, newPod *v1.Pod)
- type FullPodMetadata
- type PodMetadata
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 ¶
PodMetadata stores selected metadata of a pod populated via Kubernetes watcher events.