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 ¶
- func ContainerSpec(c *corev1.Container) model.ContainerSpecView
- func Events(evs []corev1.Event, now time.Time) []model.EventGroup
- func Node(n *corev1.Node, now time.Time) model.NodeView
- func Normalize(msg string) string
- func PDB(p *policyv1.PodDisruptionBudget) *model.PDBView
- func Pod(p *corev1.Pod, usage map[string]corev1.ResourceList, now time.Time) model.PodView
- func ReplicaSet(rs *appsv1.ReplicaSet, currentHash string, now time.Time) model.ReplicaSetView
- func Service(s *corev1.Service, ready, notReady, matched int) model.ServiceView
- func SortPods(pods []model.PodView)
- func Workload(d *appsv1.Deployment, now time.Time) *model.WorkloadView
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 ¶
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 Normalize ¶
Normalize strips the varying parts of an event message so equivalent events group together.
func PDB ¶
func PDB(p *policyv1.PodDisruptionBudget) *model.PDBView
PDB projects a PodDisruptionBudget, which explains rollouts that are stuck rather than broken.
func Pod ¶
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 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.