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 Antwort
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
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen