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 base cgroup path from known defaults. In case of environments using non-default paths, manager will fail to get a valid cgroup base path, and 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) 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 PodMetadata ¶
PodMetadata stores selected metadata of a pod populated via Kubernetes watcher events.