Skip to content

Commit

Permalink
Collect Network Policy ebpf data from log collector script (#1805)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydeokar authored May 17, 2024
1 parent c5132e9 commit 25b6f34
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions log-collector-script/linux/eks-log-collector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ collect() {
get_networking_info
get_cni_config
get_cni_configuration_variables
get_network_policy_ebpf_info
get_docker_logs
get_sandboxImage_info
get_cpu_throttled_processes
Expand Down Expand Up @@ -539,6 +540,18 @@ get_sysctls_info() {
ok
}

get_network_policy_ebpf_info() {
try "collect network policy ebpf loaded data"
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 "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
ok
}

get_networking_info() {
try "collect networking infomation"

Expand Down

0 comments on commit 25b6f34

Please sign in to comment.