Help us shape the future of Go! Take the 2026 Go Developer Survey

k8s

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 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 Client added in v0.6.0

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

func NewK8sClient

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

func (*Client) Clientset added in v0.6.0

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

func (*Client) CloseCRI added in v0.6.0

func (c *Client) CloseCRI()

TODO(kakkoyun): Why not named Close? And why it's not used?

func (*Client) ListContainers added in v0.6.0

func (c *Client) ListContainers() ([]*ContainerDefinition, error)

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

func (*Client) PodToContainers added in v0.6.0

func (c *Client) 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 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 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