cluster

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cluster reads Kubernetes pod logs for investigation (read-only) via the client-go CoreV1 GetLogs API. It backs the controller_logs tool, which surfaces why a Flux controller failed to reconcile a source/object.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader reads pod logs via a client-go clientset (read-only).

func New

func New(client kubernetes.Interface) *Reader

New builds a log Reader from a clientset.

func (*Reader) Events

func (r *Reader) Events(ctx context.Context, namespace, objectName string, warnOnly bool) ([]providers.KubeEvent, error)

Events returns recent Events in a namespace (optionally for one object, optionally Warning-only), most-recent first.

func (*Reader) PodLogs

PodLogs returns recent log lines from up to maxPods pods selected by q, bounded to the last q.SinceMinutes. When q.Previous is true it reads each pod's last-terminated container (the crash output of a CrashLoopBackOff) instead of the running one. Each line is prefixed with its pod name. Best-effort: a pod whose log stream fails is skipped, not fatal.

func (*Reader) PodStatuses

func (r *Reader) PodStatuses(ctx context.Context, namespace, labelSelector string) ([]providers.PodStatus, error)

PodStatuses returns pod health in a namespace (optional label selector), with per-container waiting/terminated reasons — surfacing pod-level failures (CreateContainerConfigError, ImagePullBackOff, CrashLoopBackOff) that never reach logs because the container never started. Unhealthy pods sort first.

Jump to

Keyboard shortcuts

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