aws/amazon-vpc-cni-k8s

pod MAC address calculation

youwalther65 opened this issue · 3 comments

What happened:

I 'd like to know the following:

  • How is the pod MAC address calculated?
  • It is persistet within IPAMD?
  • If persisted , how can I determine the the IP/MAC pair , any curl command to run against IPAMD?

Environment:

  • Kubernetes version (use kubectl version): 1.27
  • CNI Version: EKS managed add-on v1.13.2-eksbuild.1
  • OS (e.g: cat /etc/os-release):
    MAME="Amazon Linux"
    VERSION="2"
    ID="amzn"
    ID_LIKE="centos rhel fedora"
    VERSION_ID="2"
    PRETTY_NAME="Amazon Linux 2"
    ANSI_COLOR="0;33"
    CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
    HOME_URL="https://amazonlinux.com/"
    SUPPORT_END="2025-06-30"
  • Kernel (e.g. uname -a):
    Linux ip-10-0-21-238.eu-west-1.compute.internal 5.10.198-187.748.amzn2.aarch64 #1 SMP Tue Oct 24 19:49:48 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

@youwalther65 I assume you are referring to the MAC address bound to the pod IP, which would be the MAC address assigned to the eth0 interface in the pod network namespace. That MAC is assigned by the kernel (https://github.com/aws/amazon-vpc-cni-k8s/blob/master/cmd/routed-eni-cni-plugin/driver/driver.go#L114), and the address is not predictable. For the lifetime of the pod on this node, though, the MAC is the same.

Why are you looking for this information? To get it, you can always ARP for the pod IP using arping.

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days

Issue closed due to inactivity.