project

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package project reduces raw Kubernetes objects to the allowlisted fields argus emits.

Raw objects are grotesque: a single Pod carries managedFields, a full duplicate of its own spec under last-applied-configuration, resourceVersion, uid, and generated token mounts. Emitting them fills the model's context with noise, and a model reasoning from noise guesses.

Every projection here is an explicit allowlist. Never a blocklist — a blocklist silently regresses the moment Kubernetes adds a field.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerSpec

func ContainerSpec(c *corev1.Container) model.ContainerSpecView

ContainerSpec projects the desired shape of a container. Shared by Pod and by ReplicaSet template projection, which is what makes the rollout diff an apples-to-apples comparison.

func Events

func Events(evs []corev1.Event, now time.Time) []model.EventGroup

Events deduplicates raw events into groups keyed by (type, reason, normalized message, kind).

The object name is deliberately NOT part of the key. Forty pods of one Deployment reporting the same BackOff is one fact about the Deployment, not forty facts — keying on the object would produce forty near-identical groups and defeat the entire purpose. Each group instead reports how many distinct objects it covers, plus one of them as an example to drill into.

Counts respect the event's own series/count field rather than being recomputed: the apiserver already aggregates repeats server-side, so counting occurrences here would undercount by orders of magnitude on exactly the events that matter most.

func Node

func Node(n *corev1.Node, now time.Time) model.NodeView

Node projects the conditions that explain workload failures the workload did not cause.

func Normalize

func Normalize(msg string) string

Normalize strips the varying parts of an event message so equivalent events group together.

func PDB

PDB projects a PodDisruptionBudget, which explains rollouts that are stuck rather than broken.

func Pod

func Pod(p *corev1.Pod, usage map[string]corev1.ResourceList, now time.Time) model.PodView

Pod projects a pod and folds in its metrics, so a detector sees spec, status and usage together. usage is keyed by container name and may be nil when the metrics API is unavailable.

func ReplicaSet

func ReplicaSet(rs *appsv1.ReplicaSet, currentHash string, now time.Time) model.ReplicaSetView

ReplicaSet projects an RS plus its template, which is the input to the rollout diff.

func Service

func Service(s *corev1.Service, ready, notReady, matched int) model.ServiceView

Service projects a Service together with the readiness of what it selects.

ready/notReady come from EndpointSlices; matched is how many pods the selector hits at all. Keeping both is what lets the endpoint detector distinguish a label mismatch (matched == 0) from a readiness failure (matched > 0, ready == 0) — two very different incidents that look identical in `kubectl get svc`.

func SortPods

func SortPods(pods []model.PodView)

SortPods orders pods worst-first so that a truncated list still shows what matters.

func Workload

func Workload(d *appsv1.Deployment, now time.Time) *model.WorkloadView

Workload projects a Deployment. StatefulSets and DaemonSets go through their own shims because their status fields have different names for the same concepts.

Types

This section is empty.

Jump to

Keyboard shortcuts

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