Documentation ¶
Overview ¶
Package kubernetes isn't really a container runtime but wraps one to add information from PODs
Index ¶
- type Kubernetes
- func (k *Kubernetes) CachedContainer(containerID string) (c facts.Container, found bool)
- func (k *Kubernetes) ContainerExists(id string) bool
- func (k *Kubernetes) ContainerLastKill(containerID string) time.Time
- func (k *Kubernetes) Containers(ctx context.Context, maxAge time.Duration, includeIgnored bool) (containers []facts.Container, err error)
- func (k *Kubernetes) DiagnosticArchive(ctx context.Context, archive types.ArchiveWriter) error
- func (k *Kubernetes) Events() <-chan facts.ContainerEvent
- func (k *Kubernetes) Exec(ctx context.Context, containerID string, cmd []string) ([]byte, error)
- func (k *Kubernetes) IsContainerNameRecentlyDeleted(name string) bool
- func (k *Kubernetes) IsRuntimeRunning(ctx context.Context) bool
- func (k *Kubernetes) LastUpdate() time.Time
- func (k *Kubernetes) Metrics(ctx context.Context, now time.Time) ([]types.MetricPoint, error)
- func (k *Kubernetes) MetricsMinute(ctx context.Context, now time.Time) ([]types.MetricPoint, error)
- func (k *Kubernetes) ProcessWithCache() facts.ContainerRuntimeProcessQuerier
- func (k *Kubernetes) Run(ctx context.Context) error
- func (k *Kubernetes) RuntimeFact(ctx context.Context, currentFact map[string]string) map[string]string
- func (k *Kubernetes) Test(ctx context.Context) error
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) ContainerExists ¶
func (k *Kubernetes) ContainerExists(id string) bool
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) 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) RuntimeFact ¶
func (k *Kubernetes) RuntimeFact(ctx context.Context, currentFact map[string]string) map[string]string
RuntimeFact return facts about the container runtime & Kubernetes.