Sitelet https://github.com/kubernetes/kops/pull/18642
Skip to content

aws: do not set the primary network interface to "Unmanaged=yes" - #18642

Merged
kubernetes-prow[bot] merged 2 commits into
kubernetes:masterfrom
hakman:aws-eni-unmanaged-primary-interface
Jul 30, 2026
Merged

kubernetes-prow[bot] merged 2 commits into
kubernetes:masterfrom
hakman:aws-eni-unmanaged-primary-interface

Conversation

@hakman

@hakman hakman commented Jul 30, 2026

Copy link
Copy Markdown
Member

The file "10-eni-secondary.network" causes systemd-networkd to ignore the secondary ENIs. Before this change, the file found the secondary ENIs by their interface names. The names were correct only if the primary network interface had the name "ens5". But the interface names are different for each instance family and each systemd naming scheme.

On Graviton4 instances, the primary network interface has the name "ens34". The file also found this interface. Thus systemd-networkd ignored the primary network interface, and systemd-resolved had no DNS servers for it.

On 8th-generation Intel instances, the interfaces have the names "enp39s0" and "enp40s0". The file did not find these interfaces. Thus the secondary ENIs had no protection.

With this change, the file finds all the interfaces that use the "ena" driver, but does not include the primary network interface. To find the primary network interface, nodeup reads the primary MAC address from the instance metadata and compares it with the sysfs data. The file uses the udev property "INTERFACE" for this, because a "Name=" entry also agrees with the alternative names of an interface.

/cc @rifelpet @ameukam

@kubernetes-prow
kubernetes-prow Bot requested review from ameukam and rifelpet July 30, 2026 06:15
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/nodeup labels Jul 30, 2026
The file "10-eni-secondary.network" causes systemd-networkd to ignore
the secondary ENIs. Before this change, the file found the secondary
ENIs by their interface names. The names were correct only if the
primary network interface had the name "ens5". But the interface names
are different for each instance family and each systemd naming scheme.

On Graviton4 instances, the primary network interface has the name
"ens34". The file also found this interface. Thus systemd-networkd
ignored the primary network interface, and systemd-resolved had no DNS
servers for it.

On 8th-generation Intel instances, the interfaces have the names
"enp39s0" and "enp40s0". The file did not find these interfaces. Thus
the secondary ENIs had no protection.

With this change, the file finds all the interfaces that use the "ena"
driver, but does not include the primary network interface. To find the
primary network interface, nodeup reads the primary MAC address from
the instance metadata and compares it with the sysfs data. The file
uses the udev property "INTERFACE" for this, because a "Name=" entry
also agrees with the alternative names of an interface.
@hakman
hakman force-pushed the aws-eni-unmanaged-primary-interface branch from 5f9892c to ef79039 Compare July 30, 2026 06:39
systemd-networkd uses the first file that agrees with an interface.
With the number 75, the per-interface files ("10-netplan-*" on Debian,
"70-*" on AL2023) come before this file. Thus the primary network
interface keeps its own file, and this gives more protection against
an incorrect match. The number 75 also comes before the AL2023
catch-all file "80-ec2.network". Thus the secondary ENIs stay
unmanaged.

Tests on EC2 (Debian 12 and AL2023, c8g.medium) show this order: the
primary network interface keeps its per-interface file, also without
the "Property=" exclusion, and a hot-attached ENI stays unmanaged.
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rifelpet

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 30, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit c76d877 into kubernetes:master Jul 30, 2026
33 checks passed
@justinsb

Copy link
Copy Markdown
Member

Wow - thanks for fixing. Is there similar code in EKS or AWS-VPC-CNI - it feels like it would be a problem there also?

@hakman
hakman deleted the aws-eni-unmanaged-primary-interface branch July 30, 2026 11:33
kubernetes-prow Bot added a commit that referenced this pull request Jul 30, 2026
…-upstream-release-1.36

Automated cherry pick of #18642: aws: do not set the primary network interface to "Unmanaged=yes"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/nodeup cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants