github.com/cilium/cilium@v1.16.2/Documentation/network/pod-mac-address.rst (about)

     1  .. only:: not (epub or latex or html)
     2  
     3      WARNING: You are looking at unreleased Cilium documentation.
     4      Please use the official rendered version released here:
     5      https://docs.cilium.io
     6  
     7  .. _pod_mac_address:
     8  
     9  ************************************
    10  Use a Specific MAC Address for a Pod
    11  ************************************
    12  
    13  Some applications bind software licenses to network interface MAC addresses.
    14  Cilium provides the ability to specific MAC addresses for pods
    15  at deploy time instead of letting the operating system allocate them.
    16  
    17  
    18  Configuring the address
    19  #######################
    20  
    21  Cilium will configure the MAC address for the primary interface inside a
    22  Pod if you specify the MAC address in the ``cni.cilium.io/mac-address``
    23  annotation before deploying the Pod.
    24  This MAC address is isolated to the container so it will
    25  not collide with any other MAC addresses assigned to other Pods on the same
    26  node. The MAC address must be specified **before** deploying the Pod.
    27  
    28  Annotate the pod with ``cni.cilium.io/mac-address`` set to the desired MAC address.
    29  For example:
    30  
    31  .. code-block:: yaml
    32  
    33      apiVersion: v1
    34      kind: Pod
    35      metadata:
    36        annotations:
    37          cni.cilium.io/mac-address: e2:9c:30:38:52:61
    38        labels:
    39          app: busybox
    40        name: busybox
    41        namespace: default
    42  
    43  Deploy the Pod. Cilium will configure the mac address to the first interface in the Pod automatically.
    44  Check whether its mac address is the specified mac address.
    45  
    46  .. code-block:: shell-session
    47  
    48      $ kubectl exec -it busybox -- ip addr
    49      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
    50          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    51          inet 127.0.0.1/8 scope host lo
    52             valid_lft forever preferred_lft forever
    53          inet6 ::1/128 scope host
    54             valid_lft forever preferred_lft forever
    55      7: eth0@if8: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue qlen 1000
    56          link/ether e2:9c:30:38:52:61 brd ff:ff:ff:ff:ff:ff
    57          inet 10.244.2.195/32 scope global eth0
    58             valid_lft forever preferred_lft forever
    59          inet6 fe80::e46d:f4ff:fe4d:ebca/64 scope link
    60             valid_lft forever preferred_lft forever