Repository navigation
fix(node-metrics): keep pods whose netns AppArmor blocks on the procdev fallback - #1442
Merged
Merged
Conversation
…ev fallback podNetnsTarget rejected a pod when no container's /proc/$pid/ns/net could be stat'ed. For privileged pods that is not a vanished process but an AppArmor denial: node-metrics runs under cri-containerd.apparmor.d, which denies the ptrace read on unconfined processes. Before #1439 such pods still got a handle and their traffic from /proc/$pid/net/dev (allowed by the profile); since then they got no traffic at all (seen for lwz-monitor on homeserver and kured on relay). Only a missing namespace skips a container now; a blocked one is still registered. Register/Remove errors are logged as text instead of `{}`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem (regression from #1439)
After rolling out
2.35.0-develop.855on homeserver, two privileged pods lost their traffic metrics entirely (lwz-monitoron homeserver,kuredon relay):podNetnsTarget(new in #1439) only accepts a container whose/proc/$pid/ns/netcan be stat'ed. node-metrics runs under thecri-containerd.apparmor.dprofile, which denies the ptrace read on unconfined processes, i.e. those of privileged pods:Checked under that profile on homeserver:
stat /proc/<pid>/ns/net→Permission denied,/proc/<pid>/net/dev→ readable, no denial. Before #1439 such a pod still got a handle; nsenter failed, andMetrics()served it from/proc/$pid/net/dev. Since #1439 it was dropped.Fix
ErrNotExist, vanished first process) skips a container. A blocked one is still registered, so the pod is back on the procdev fallback like before.errors.Joininstead of as a[]errorthat marshals to[{}].Rest of the rollout check (homeserver, develop.855)
update_tc_ingress+ 62update_tc_egressattached via tcx, no XDP,lountouched, host veth keepstx-tcp-segmentation: ongo build,go vet,golangci-lintclean.🤖 Generated with Claude Code