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

kubernetes

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const KubeConfigEnv = "KUBECONFIG"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewKubernetesClient

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

func (*Client) Clientset

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

func (*Client) Close

func (c *Client) Close() error

func (*Client) ListContainers

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

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

func (*Client) PodToContainers

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

type PodInformer

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

func NewPodInformer

func NewPodInformer(logger log.Logger, node 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()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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