DeviceIndex is not respected when processing multiple network interfaces on a node
elmiko opened this issue · 3 comments
What happened:
In cases where a node has multiple network interfaces, the order in which they are listed from AWS is applied directly to the interfaces list that the CCM produces. Depending on the ordering from AWS, this may or may not be accurate for the node being deployed. Even when DeviceIndex
is specified, it is not respected.
For example, given this data from AWS:
{
"Reservations": [
{
"Instances": [
{
"NetworkInterfaces": [
{
"Attachment": {
"DeviceIndex": 1,
},
"MacAddress": "02:0f:d9:6d:bf:eb",
"PrivateIpAddress": "100.64.2.164",
},
{
"Attachment": {
"DeviceIndex": 0,
},
"MacAddress": "02:5c:60:51:b1:29",
"PrivateIpAddress": "10.175.4.157",
}
],
}
],
}
]
}
The interface with MAC 02:5c:60:51:b1:29
should be the first interface by its DeviceIndex
, yet it is the second interface due to the ordering from AWS.
What you expected to happen:
When DeviceIndex
is specified, I expect it to be honored when ordering the network interfaces.
How to reproduce it (as minimally and precisely as possible):
- create a node with multiple network interfaces, and device indexes specified
- ensure that the ordering from AWS is wrong from device index, or set the device indexes to be wrong based on the MAC address ordering
- inspect the primary network interface IP on the node object created
Anything else we need to know?:
this was solved in the in-tree cloud controller but appears to have not been ported to the out-of-tree controller, see kubernetes/kubernetes#80747
this is the current code in the external ccm, https://github.com/openshift/cloud-provider-aws/blob/release-4.14/pkg/providers/v1/aws.go#L1515
Environment:
- Kubernetes version (use
kubectl version
): - Cloud provider or hardware configuration:
- OS (e.g. from /etc/os-release):
- Kernel (e.g.
uname -a
): - Install tools:
- Others:
/kind bug
This issue is currently awaiting triage.
If cloud-provider-aws contributors determine this is a relevant issue, they will accept it by applying the triage/accepted
label and provide further guidance.
The triage/accepted
label can be added by org members by writing /triage accepted
in a comment.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
There's a PR pending for this: #909 👍
great to hear, thanks @cartermckinnon !