Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimal nettop so that we avoid scan the whole /proc #139

Merged
merged 7 commits into from
Jan 10, 2024

Conversation

jzwlqx
Copy link
Collaborator

@jzwlqx jzwlqx commented Jan 2, 2024

to achieve this goal, we use local cri interface to get required pod information, such as netns, ip, pids.

cri v1 has GetContainerEvents methon that can be used to watch container change events, once container changed, we can call ContainerStatus to get container detail info. Unfortunately there is a bug in containerd: only one caller of GetContainerEvents is supported. So now we have to list containers periodically to get caontiner info.

cri interface return only root pid for every container, so we read cgroup tasks to get all pids of pods.

@jzwlqx jzwlqx requested review from Lyt99 and BSWANG January 2, 2024 03:04
jzwlqx added 5 commits January 8, 2024 16:49
to achieve this goal, we use local cri interface to
get required pod information, such as netns, ip, pids.

cri v1 has GetContainerEvents methon that can be used
to watch container change events, once container changed,
we can call ContainerStatus to get container detail info.
Unfortunately there is a bug in containerd: only one caller
of GetContainerEvents is supported. So now we have to list
containers periodically to get caontiner info.
@jzwlqx jzwlqx force-pushed the feature/optimize_netop branch from 581cea8 to d15f927 Compare January 8, 2024 08:50
@jzwlqx jzwlqx requested a review from BSWANG January 9, 2024 09:17
@jzwlqx jzwlqx requested a review from Lyt99 January 10, 2024 03:25
@BSWANG BSWANG merged commit e276b14 into alibaba:main Jan 10, 2024
8 checks passed
@jzwlqx jzwlqx deleted the feature/optimize_netop branch February 7, 2024 06:51
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.

3 participants