bypassing udev interference by assigning mac address to host side veth - #3354
Merged
Conversation
haouc
reviewed
Jul 25, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR addresses a bug where MAC address policies in udev were interfering with container networking by assigning a specific MAC address to the host-side veth interface when creating veth pairs. This prevents udev from overriding the MAC address based on its own policy settings.
Key changes:
- Added MAC address generation for host-side veth interfaces
- Updated test infrastructure to support MAC address policy testing
- Updated Go module dependencies
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| cmd/routed-eni-cni-plugin/driver/driver.go | Implements MAC address generation and assignment for host-side veth interfaces |
| cmd/routed-eni-cni-plugin/driver/driver_test.go | Adds tests for MAC generation and updates existing tests to handle MAC addresses |
| test/integration/cni/pod_traffic_test.go | Adds integration tests for verifying pod connectivity under different MAC address policies |
| go.mod | Updates various golang.org/x/... dependencies to newer versions |
M00nF1sh
reviewed
Jul 28, 2025
jaydeokar
reviewed
Jul 28, 2025
jaydeokar
reviewed
Jul 28, 2025
| pod = manifest.NewDefaultPodBuilder(). | ||
| NodeName(primaryNode.Name). | ||
| Container(manifest.NewBusyBoxContainerBuilder(f.Options.TestImageRegistry).Build()). | ||
| Namespace("default"). |
Collaborator
There was a problem hiding this comment.
nit - You should change this to run in the test namespace which we create
jaydeokar
previously approved these changes
Jul 28, 2025
jaydeokar
reviewed
Jul 28, 2025
jaydeokar
approved these changes
Jul 28, 2025
This was referenced Aug 12, 2025
yash97
added a commit
to yash97/amazon-vpc-cni-k8s
that referenced
this pull request
Jul 20, 2026
…smatch The daily kops test (`.github/workflows/kops-test.yaml`) has failed on every scheduled run for months. `kops validate cluster` never succeeds and the run dies at `scripts/lib/cluster.sh` line 125 (`kubectl delete daemonset ...`) because the API server behind the NLB is never reachable (`dial tcp ...:443: connect: connection refused`). Root cause: `up-kops-cluster` pinned the node OS to Ubuntu 20.04, which ships glibc 2.31. kops 1.34 installs containerd 2.1.x, whose dynamically-linked release binary is built with glibc 2.35 (Ubuntu 22.04) and imports GLIBC_2.32 and GLIBC_2.34 symbols. On 20.04 the binary cannot exec: /usr/bin/containerd: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found /usr/bin/containerd: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found containerd crash-loops, kubelet fails to reach the CRI socket, the static kube-apiserver pod never starts, the NLB apiserver target group stays unhealthy, and validation fails. Fix: pin the node image to Ubuntu 22.04 (glibc 2.35), which satisfies the containerd requirement. The original 20.04 pin (aws#2103) worked around a veth MAC address change on 22.04's newer kernel/udev that left the CNI's static ARP entry for the gateway stale and broke pod egress; that is fixed in the CNI itself by aws#3354 (assigns the host-side veth MAC so udev's MACAddressPolicy leaves it untouched), so the 20.04 pin is no longer required. Verified by provisioning a cluster on 22.04: containerd v2.1.4 boots cleanly, all control-plane apiserver NLB targets become healthy, `kops validate cluster` reports "is ready", and cross-node pod-to-pod, ClusterIP/CoreDNS, and egress connectivity all work.
yash97
added a commit
that referenced
this pull request
Jul 24, 2026
…smatch (#3789) * test: bump kops node image to Ubuntu 22.04 to fix containerd glibc mismatch The daily kops test (`.github/workflows/kops-test.yaml`) has failed on every scheduled run for months. `kops validate cluster` never succeeds and the run dies at `scripts/lib/cluster.sh` line 125 (`kubectl delete daemonset ...`) because the API server behind the NLB is never reachable (`dial tcp ...:443: connect: connection refused`). Root cause: `up-kops-cluster` pinned the node OS to Ubuntu 20.04, which ships glibc 2.31. kops 1.34 installs containerd 2.1.x, whose dynamically-linked release binary is built with glibc 2.35 (Ubuntu 22.04) and imports GLIBC_2.32 and GLIBC_2.34 symbols. On 20.04 the binary cannot exec: /usr/bin/containerd: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found /usr/bin/containerd: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found containerd crash-loops, kubelet fails to reach the CRI socket, the static kube-apiserver pod never starts, the NLB apiserver target group stays unhealthy, and validation fails. Fix: pin the node image to Ubuntu 22.04 (glibc 2.35), which satisfies the containerd requirement. The original 20.04 pin (#2103) worked around a veth MAC address change on 22.04's newer kernel/udev that left the CNI's static ARP entry for the gateway stale and broke pod egress; that is fixed in the CNI itself by #3354 (assigns the host-side veth MAC so udev's MACAddressPolicy leaves it untouched), so the 20.04 pin is no longer required. Verified by provisioning a cluster on 22.04: containerd v2.1.4 boots cleanly, all control-plane apiserver NLB targets become healthy, `kops validate cluster` reports "is ready", and cross-node pod-to-pod, ClusterIP/CoreDNS, and egress connectivity all work. * test: bump kops and k8s to 1.36 so node role gets ec2:DescribeSubnets Even with the Ubuntu 22.04 fix (control plane now comes up), the daily kops run fails at the aws-node DaemonSet rollout: one pod stays 1/2 Ready because the aws-node (ipamd) container crashes with MissingIAMPermissions: Unauthorized operation: failed to call ec2:DescribeSubnets due to missing permissions kops generates the node instance-role policy for the VPC CNI automatically when --networking amazonvpc is set (addAmazonVPCCNIPermissions in pkg/model/iam/iam_builder.go). In kops 1.34 that generated policy is missing ec2:DescribeSubnets, which the CNI's ipamd calls on startup; ipamd exits, its gRPC socket never opens, the readiness probe (grpc-health-probe on ipamd.sock) times out, the DaemonSet rollout never completes, and `kubectl rollout status --timeout=10m` fails (scripts/lib/k8s.sh). kops added ec2:DescribeSubnets to the CNI node policy in 1.36 (kubernetes/kops 1.36 release notes). Bump KOPS_VERSION to v1.36.0 and K8S_VERSION to 1.36.2 (kops 1.36 supports k8s 1.36 natively, so the KOPS_RUN_TOO_NEW_VERSION override is no longer needed and is removed). * test: scope kops conformance to [sig-network], drop redundant serial pass The kops job ran the full Kubernetes [Conformance] suite (~555 specs across sig-node/sig-storage/sig-auth/sig-apps/scheduling/...). That took >120 minutes and tripped `--ginkgo.timeout=120m`, reporting `FAIL! - Suite Timeout Elapsed` even though 321/322 executed specs passed (the one failure was a transient NodeNotReady blip, not a CNI defect). None of the non-network specs exercise the CNI datapath. Scope the run to `[sig-network].*[Conformance]` (47 specs: pod-to-pod, Services /ClusterIP, DNS, NetworkPolicy, EndpointSlice, etc.) — the conformance that actually validates the VPC CNI. All [sig-network] Conformance specs are parallel-safe (there are no [Serial] ones), so the separate serial pass is removed. This keeps the run well under the timeout while still gating on real CNI behavior. * test: trim kops fix comments to essentials * test: drop timeout note from conformance comment * test: correct conformance comment (no NetworkPolicy in sig-network conformance)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
bug
Which issue does this PR fix?:
Fixes #2103
What does this PR do / Why do we need it?:
This PR assigns mac address to host side veth when creating veth pair for container.
This will help resolve dependency on Mac address policy dependency for cni. It will not break pod networking. Ref code in udev where it will not assign Mac if user has provided mac address. https://github.com/systemd/systemd/blob/v257.7/src/udev/net/link-config.c#L609.
Testing done on this change:
Added New integration test which checks the egress connectivity for pod with Mac address policy to
Noneand toPersistenthave added asskipblock. Will remove it after release.Will this PR introduce any new dependencies?:
Will this break upgrades or downgrades? Has updating a running cluster been tested?:
Does this change require updates to the CNI daemonset config files to work?:
Does this PR introduce any user-facing change?:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.