Skip to main content

POST /pod/spec

Insert or update pod metadata. Upserts on pod_name (the primary key) — a pod restarting reusing the same name replaces the previous row in place. Empty/whitespace-only pod_name is rejected at the handler (warn-log + no-op) to keep a sentinel empty-PK row from polluting the table.

Request

pod_identity and workload_selector_labels are populated by the controller’s extract_pod_identity_and_selectors helper (priority: app.kubernetes.io/nameapp.kubernetes.io/componentk8s-app → owner-reference walk to Deployment/StatefulSet/DaemonSet).

POST /pod/mark_dead

Mark a pod’s row as dead without deleting it (preserves historical correlation against pod_traffic rows referencing the same IP). The controller’s reconcile_pods_task calls this periodically for pods that left the node — sending pod_ip alongside pod_name lets the broker apply a precise (pod_name, pod_ip) filter rather than a name-only one, avoiding the race where a same-name restart’s live row gets marked dead.

Request

pod_ip is optional for backwards compatibility with older controllers; when absent, the broker falls back to a name-only filter (and logs a warn for the missing precision). Empty pod_name is rejected.

GET /pod/info

Return all pod metadata rows. Ordered by (pod_namespace ASC, pod_name ASC) for stable display. The stored/returned pod_obj is compacted, not the full manifest: only metadata (minus managedFields) and spec.hostNetwork are kept — containers, volumes, and status are dropped.

GET /pod/name/{name}

Get a single pod by name. Returns the live row when one exists (falls back to the most-recent dead row only if no live row matches — defensive for a hypothetical future schema where multiple rows per pod_name are possible).

GET /pod/ip/{ip}

Get a single pod by IP. Used by the advisor when resolving a peer IP to a pod identity during NetworkPolicy generation.
A 404 with body "No data found" is returned when no row matches.

GET /pod/list/{node}

Return all live pods recorded for the named node. The controller’s reconciler calls this to compute the dead-pod diff each cycle. Filtered to is_dead=false; ordered by (pod_namespace ASC, pod_name ASC) so reconciler “marking X as dead” log sequences are deterministic.