Skip to content

Feature: pod annotation metadata - #2399

Open
nyadav4-ai wants to merge 6 commits into
pixie-io:mainfrom
nyadav4-ai:featurepod-annotation-metadata
Open

Feature: pod annotation metadata#2399
nyadav4-ai wants to merge 6 commits into
pixie-io:mainfrom
nyadav4-ai:featurepod-annotation-metadata

Conversation

@nyadav4-ai

Copy link
Copy Markdown

Summary:
Adds Kubernetes pod annotations to Pixie's metadata pipeline, mirroring the existing pod-labels support. Pod annotations often carry operationally useful metadata (team/ownership tags, GitOps/CI info, config checksums), which was previously not queryable in Pixie.

Relevant Issues: #2398

Type of change: /kind api-change

Test Plan:

  • Unit tests for the metadata handler allowlist filtering (TestHandler_PodAnnotationAllowlist in k8s_metadata_handler_test.go), covering empty/nil allowlists, allowed keys, and non-matching keys. The test drives the allowlist end-to-end through NewHandler and the NATS update path.
  • Updated Go metadata handler/topic-listener tests.
  • C++ metadata state test verifies annotations are stored on PodInfo (metadata_state_test.cc).
  • C++ UDF test verifies pod_id_to_pod_annotations output (metadata_ops_test.cc).
  • Manual: deploy Vizier with PL_POD_ANNOTATION_ALLOWLIST set and confirm allowlisted annotations appear via px.pod_id_to_pod_annotations in a PxL script, and that unlisted keys are dropped.

Changelog Message:
Add support for capturing Kubernetes pod annotations in metadata (opt-in via the PL_POD_ANNOTATION_ALLOWLIST allowlist), queryable in PxL with px.pod_id_to_pod_annotations.

Add a JSON-encoded `annotations` string to PodUpdate so pod
annotations can be propagated through the metadata pipeline,
mirroring the existing `labels` field. Regenerates the Go proto.
Filter pod annotations to an operator-configured allowlist
(`pod_annotation_allowlist`) before emitting them in pod updates.
Annotations can be large/noisy (e.g. last-applied-configuration),
so an empty allowlist captures nothing by default.
Plumb the new annotations field into PodInfo so the agent-side
metadata state retains pod annotations for downstream consumers.
Expose pod annotations to PxL via a new UDF, analogous to
pod_id_to_pod_labels.
Surface the pod annotation allowlist as an env var on the metadata
deployment and statefulset so it is configurable at deploy time.
metadata: consolidate pod annotation allowlist test into handler test

Move the pod annotation allowlist coverage out of the standalone
k8s_metadata_annotations_test.go and into k8s_metadata_handler_test.go,
alongside the other handler tests. The test now exercises the allowlist
end-to-end through NewHandler.
@nyadav4-ai
nyadav4-ai requested review from a team as code owners July 27, 2026 09:29
@nyadav4-ai
nyadav4-ai requested a deployment to pr-actions-approval July 27, 2026 09:29 — with GitHub Actions Waiting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant