Repository navigation
Add PxL UDFs to look up the host IP of a pod - #2414
Open
NopeCharon wants to merge 1 commit into
Open
NopeCharon wants to merge 1 commit into
NopeCharon wants to merge 1 commit into
Conversation
PxL scripts can look up the node name of a pod, but not the IP address of that node. This makes it hard to filter out traffic that originates from the node, such as kubelet liveness and readiness probes, which arrive from the node's IP address. The metadata service already sends the pod's status.hostIP to the agents in PodUpdate.host_ip, but the agents only used it to filter host network pods out of the IP to pod lookup. PodInfo now stores the host IP, and two new UDFs expose it: - px.pod_id_to_host_ip(pod_id) - px.pod_name_to_host_ip(pod_name) Both return an empty string if the pod is unknown, like the other pod metadata UDFs. Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
NopeCharon
requested a deployment
to
pr-actions-approval
October 27, 2026 07:02 — with
GitHub Actions
Waiting
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary: Add PxL UDFs to look up the host IP of a pod
As described in the issue, PxL scripts can look up the node name of a pod with
px.pod_id_to_node_name, but there is no way to get the node's IP address. That makes it hard to filter out traffic that comes from the node itself, such as kubelet liveness, readiness and startup probes.The metadata service already sends the pod's
status.hostIPto the agents inPodUpdate.host_ip, but the agents only used it to keep host network pods out of the IP to pod lookup. This PR stores the host IP inPodInfoand adds two UDFs that return it:px.pod_id_to_host_ip(pod_id)px.pod_name_to_host_ip(pod_name)Like the other pod metadata UDFs, both return an empty string if the pod is unknown. For the use case in the issue, a script can now do:
Relevant Issues: Fixes #1251
Type of change: /kind feature
Test Plan: Added
pod_id_to_host_ip_testandpod_name_to_host_ipto//src/carnot/funcs/metadata:metadata_ops_test, and ahost_ip()check to theHandlePodUpdatetest in//src/shared/metadata:metadata_state_test. I could not run the Bazel targets locally because my build machine is aarch64 and the toolchain needs an x86_64 host, so I'm relying on CI for those. The new code follows the existingpod_name_to_pod_ipandpod_id_to_node_nameUDFs. clang-format is clean on the changed files and cpplint reports nothing new.Changelog Message: