Skip to content

Adding dumps from CNP maps#2567

Merged
fletcherw merged 1 commit intoawslabs:mainfrom
jaydeokar:main
Mar 20, 2026
Merged

Adding dumps from CNP maps#2567
fletcherw merged 1 commit intoawslabs:mainfrom
jaydeokar:main

Conversation

@jaydeokar
Copy link
Contributor

@jaydeokar jaydeokar commented Dec 17, 2025

Issue #, if available:
N/A
Description of changes:

This dumps the CP map along with the regular network policy maps

export COLLECT_DIR=/tmp/

  if [[ -x /opt/cni/bin/aws-eks-na-cli ]]; then
    echo "*** EBPF loaded data ***" >> "${COLLECT_DIR}"/networking/ebpf-data.txt
    LOADED_EBPF=$(/opt/cni/bin/aws-eks-na-cli ebpf loaded-ebpfdata | tee -a "${COLLECT_DIR}"/networking/ebpf-data.txt)

    for mapid in $(echo "$LOADED_EBPF" | grep -E 'Map Name:[[:space:]]*(cp_ingress_map|cp_egress_map)' -A1 | grep "Map ID:" | sed 's/Map ID: \+//' | sort | uniq); do
      echo "*** EBPF Maps Data for Map ID $mapid ***" >> "${COLLECT_DIR}"/networking/ebpf-cp-maps-data.txt
      /opt/cni/bin/aws-eks-na-cli ebpf dump-cp-maps $mapid >> "${COLLECT_DIR}"/networking/ebpf-cp-maps-data.txt
    done

    for mapid in $(echo "$LOADED_EBPF" | grep -E 'Map Name:[[:space:]]*(ingress_map|egress_map)' -A1 | grep "Map ID:" | sed 's/Map ID: \+//' | sort | uniq); do
      echo "*** EBPF Maps Data for Map ID $mapid ***" >> "${COLLECT_DIR}"/networking/ebpf-maps-data.txt
      /opt/cni/bin/aws-eks-na-cli ebpf dump-maps $mapid >> "${COLLECT_DIR}"/networking/ebpf-maps-data.txt
    done
  fi



ls -la /tmp/networking/
total 16
drwxr-xr-x.  2 root root  100 Dec 17 01:55 .
drwxrwxrwt. 11 root root  220 Dec 17 01:56 ..
-rw-r--r--.  1 root root  224 Dec 17 01:55 ebpf-cp-maps-data.txt
-rw-r--r--.  1 root root 2905 Dec 17 01:55 ebpf-data.txt
-rw-r--r--.  1 root root 5735 Dec 17 01:55 ebpf-maps-data.txt

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Testing Done

See this guide for recommended testing for PRs. Some tests may not apply. Completing tests and providing additional validation steps are not required, but it is recommended and may reduce review time and time to merge.

@github-actions
Copy link
Contributor

This pull request is stale because it has been open for 60 days with no activity. Remove the stale label or comment to avoid closure in 14 days

@github-actions github-actions bot added the Stale label Feb 16, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Pull request closed due to inactivity.

@github-actions github-actions bot closed this Mar 3, 2026
@jaydeokar
Copy link
Contributor Author

/not-stale

@jaydeokar
Copy link
Contributor Author

@wwvela @shvbsle Can we reopen this PR please ? This is required for debugging Network Policies

@HusainZafar HusainZafar reopened this Mar 17, 2026
@github-actions github-actions bot removed the Stale label Mar 18, 2026
@fletcherw fletcherw merged commit 2ac5fc0 into awslabs:main Mar 20, 2026
11 checks passed
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