kubernetes

package
v0.0.0-...-d79780e Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package kubernetes isn't really a container runtime but wraps one to add information from PODs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kubernetes

type Kubernetes struct {
	Runtime crTypes.RuntimeInterface
	// NodeName is the node Glouton is running on. Allow to fetch only
	// relevant PODs (running on the same node) instead of all PODs.
	NodeName string
	// KubeConfig is a kubeconfig file to use for communication with
	// Kubernetes. If not provided, use in-cluster auto-configuration.
	KubeConfig         string
	IsContainerIgnored func(facts.Container) bool
	// ShouldGatherClusterMetrics returns whether this agent should gather global cluster metrics.
	ShouldGatherClusterMetrics func() bool
	// ClusterName is the name of the Kubernetes cluster.
	ClusterName string
	// contains filtered or unexported fields
}

Kubernetes wraps a container runtime to add information from PODs. It will add annotation, IP detection, flag "StoppedAndRestarted".

func (*Kubernetes) CachedContainer

func (k *Kubernetes) CachedContainer(containerID string) (c facts.Container, found bool)

CachedContainer return the container for given ID.

func (*Kubernetes) ContainerLastKill

func (k *Kubernetes) ContainerLastKill(containerID string) time.Time

ContainerLastKill return last time a containers was killed.

func (*Kubernetes) Containers

func (k *Kubernetes) Containers(ctx context.Context, maxAge time.Duration, includeIgnored bool) (containers []facts.Container, err error)

Containers return all known container, with annotation added.

func (*Kubernetes) DiagnosticArchive

func (k *Kubernetes) DiagnosticArchive(ctx context.Context, archive types.ArchiveWriter) error

func (*Kubernetes) Events

func (k *Kubernetes) Events() <-chan facts.ContainerEvent

Events return container events.

func (*Kubernetes) Exec

func (k *Kubernetes) Exec(ctx context.Context, containerID string, cmd []string) ([]byte, error)

Exec run command in the containers.

func (*Kubernetes) IsContainerNameRecentlyDeleted

func (k *Kubernetes) IsContainerNameRecentlyDeleted(name string) bool

func (*Kubernetes) IsRuntimeRunning

func (k *Kubernetes) IsRuntimeRunning(ctx context.Context) bool

IsRuntimeRunning tells if Glouton is connected to the container runtime. Note: if Kubernetes isn't working but the underlying container runtime works, this method return true, but POD information will be missing.

func (*Kubernetes) LastUpdate

func (k *Kubernetes) LastUpdate() time.Time

LastUpdate return the last time containers list was updated.

func (*Kubernetes) Metrics

func (k *Kubernetes) Metrics(ctx context.Context, now time.Time) ([]types.MetricPoint, error)

func (*Kubernetes) MetricsMinute

func (k *Kubernetes) MetricsMinute(ctx context.Context, now time.Time) ([]types.MetricPoint, error)

func (*Kubernetes) ProcessWithCache

func (k *Kubernetes) ProcessWithCache() facts.ContainerRuntimeProcessQuerier

ProcessWithCache implement ContainerRuntimeProcessQuerier.

func (*Kubernetes) Run

func (k *Kubernetes) Run(ctx context.Context) error

Run the connector.

func (*Kubernetes) RuntimeFact

func (k *Kubernetes) RuntimeFact(ctx context.Context, currentFact map[string]string) map[string]string

RuntimeFact return facts about the container runtime & Kubernetes.

func (*Kubernetes) Test

func (k *Kubernetes) Test(ctx context.Context) error

Test check if connector is able to get PODs.

Jump to

Keyboard shortcuts

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