Get NIC of EKS pod/service

0

I suppose, node/ec2 can have multiple NICs. POD will connect to one of node's NIC (nay be through it's veth). I am trying to find NIC of a node which particular pod uses to communicate with other pods/internet. I could not get any information of network infrastructure of pod/service using kubectl command or APIs of K8S/AWS. Can you please suggest (preferably) APIs or commands which can help me get nic information of service/pod? Or how to find pod to pod path?

1개 답변
0

Hello,

In order to find the NIC of a node which particular pod uses to communicate, you can use this command :

First, to get the pod IP : $ kubectl get pod <POD_NAME> Then, to list the NICs [1]: $ aws ec2 describe-network-interfaces --filters Name=addresses.private-ip-address,Values=<POD_IP> query ‘NetworkInterfaces[*].{ID:NetworkInterfaceId}’

You just need to replace <POD_NAME> with the name of your Pod and <POD_IP> with the IP address of your pod.

As for your query regarding finding pod to (pod/service/internet) route, run this troubleshooting pod that contains networking tools such as ‘traceroute’ which enables you to trace pod to pod communication route $ kubectl run tmp-shell-host --rm -it --image nicolaka/netshoot -- /bin/bash $ traceroute, tcptraceroute

[1] - https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-network-interfaces.html

AWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠