Repository navigation
feat(k8snode): link cilium-cni logs in container runtime logs to Pods - #1260
Merged
Merged
Conversation
kyasbal
requested review from
K53,
RyuSA,
jyane,
kkuchima and
renamoo
as code owners
November 12, 2026 01:46
This was referenced Nov 12, 2026
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for parsing and processing cilium-cni plugin logs from containerd. It adds utility functions to identify cilium-cni logs and extract their pod references, updates the log processor to include these details in the log summary without duplication, and links the logs to the corresponding pod timeline. Comprehensive unit tests are also added. The reviewer suggested using a case-insensitive comparison (strings.EqualFold) when checking the Kubernetes resource kind to ensure robustness.
kyasbal
force-pushed
the
push-ottutrxmkoxp
branch
from
November 12, 2026 07:00
0d96767 to
12fde7f
Compare
containerd writes the logs of the cilium-cni plugin of GKE Dataplane V2 into the container runtime log in logfmt with the subsys, k8sNamespace and k8sPodName fields. Previously these logs were linked to Pods only when the pod sandbox ID was resolvable from a RunPodSandbox log in the inspected range or the Pod UID was known from audit logs. Use the Pod fields to always add the log to the timeline of the Pod. Prefix the summary of every cilium-cni log with the subsystem, and append the Pod name without appending the Pod again when the pod sandbox ID or the Pod UID in the log resolves to the same Pod.
kyasbal
force-pushed
the
push-ottutrxmkoxp
branch
from
November 17, 2026 05:25
12fde7f to
fcf7d25
Compare
Code Quality Report — ✅ Cloud Build
|
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
Links the cilium-cni plugin logs written into the container runtime (containerd) log to the timelines of their Pods, and makes their summaries easier to read.
Stacked on #1259. Part of the GKE Dataplane V2 log support stack.
Motivation
containerd writes the logs of the GKE Dataplane V2 CNI plugin into its own log in logfmt, with
subsys=cilium-cni,k8sNamespaceandk8sPodNamefields. Previously these logs were linked to a Pod only when the pod sandbox ID could be resolved from aRunPodSandboxlog in the inspected range, or when audit logs knew the Pod UID. Endpoint setup and teardown errors (for exampledeleteEndpointNotFoundorUnable to open network namespace) often did not appear on the Pod they belong to.Changes
isCiliumCNILogandfindCiliumCNIPodReferenceink8snode/impl/parser_utility.go.processK8sNodeLog:[cilium-cni], and trims the trailing space that the plugin can leave in its messages.k8sNamespaceandk8sPodName. A pod sandbox ID or a Pod UID that resolves to the same Pod is not appended again in another format.mapContainerdLog: always adds the log to the timeline of the Pod written in the log.Screenshots
Verified on real container runtime logs: 539 cilium-cni logs, each linked to the Pod timeline, the owner alias and the containerd timeline.
Verification
make pre-commitmake build-go && make lint-go && make test-go