k8s

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const KubeConfigEnv = "KUBECONFIG"

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerDefinition

type ContainerDefinition struct {
	NodeName      string
	ContainerId   string
	CgroupPath    string
	CgroupId      uint64
	Mntns         uint64
	Namespace     string
	PodName       string
	ContainerName string
	PodLabels     map[string]string
	CgroupV1      string
	CgroupV2      string
	MountSources  []string
	Pid           int
}

func (*ContainerDefinition) Labels

func (c *ContainerDefinition) Labels() []*profilestorepb.Label

func (*ContainerDefinition) PerfEventCgroupPath

func (c *ContainerDefinition) PerfEventCgroupPath() string

type K8sClient

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

func NewK8sClient

func NewK8sClient(logger log.Logger, nodeName string) (*K8sClient, error)

func (*K8sClient) Clientset

func (c *K8sClient) Clientset() kubernetes.Interface

func (*K8sClient) CloseCRI

func (k *K8sClient) CloseCRI()

func (*K8sClient) ListContainers

func (k *K8sClient) ListContainers() (arr []ContainerDefinition, err error)

ListContainers return a list of the current containers that are running in the node.

func (*K8sClient) PodToContainers

func (k *K8sClient) PodToContainers(pod *v1.Pod) []ContainerDefinition

PodToContainers return a list of the containers of a given Pod. Containers that are not running or don't have an ID are not considered.

type PodInformer

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

func NewPodInformer

func NewPodInformer(logger log.Logger, node, podLabelSelector string, clientset kubernetes.Interface, createdPodChan chan *v1.Pod, deletedPodChan chan string) (*PodInformer, error)

func (*PodInformer) Run

func (p *PodInformer) Run(threadiness int, stopCh chan struct{})

func (*PodInformer) Stop

func (p *PodInformer) Stop()

Jump to

Keyboard shortcuts

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