client.network_interface configuration is not respected when running in AWS or Azure
- Dominant language
- Go
- Stars
- 17k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 105
Description
### Nomad version
Output from `nomad version`
```
Nomad v1.1.3 (8c0c8140997329136971e66e4c2337dfcf932692)
```
### Operating system and Environment details
Instance s1-2 in OVH Cloud - WAW DC
```
# uname -a
Ubuntu 20.04 LTS
Linux worker0 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
```
### Issue
Nomad does not respect `client.network_interface` configuation when running in AWS or Azure
### Reproduction steps
Check the code
https://github.com/hashicorp/nomad/blob/1403a06b99b07b6ba9dc5b184005aa8bed316d39/client/fingerprint/env_aws.go#L138
https://github.com/hashicorp/nomad/blob/1403a06b99b07b6ba9dc5b184005aa8bed316d39/client/fingerprint/env_azure.go#L174
I found this issue when I installed nomad in OVH Cloud (WAW DC) on instance s1-2 and nomad detected provider as AWS. After few hours of debuggin, I found out OVH in this DC has running service on address 169.254.169.254 that returns AWS data (reported issue to OVH, their internal ticket 2847070). Also it turns out that nomad will change `unique.network.ip-address` to address found in this service, that caused missconfig in my case.
#### Expected Result
`unique.network.ip-address` is set with value defined in `client.network_interface` configuation
#### Actual Result
`unique.network.ip-address` is overwritten with value found in cloud provider address
### Fix proposals:
- add information in documantation "it's not a bug, it's a feature" (https://www.nomadproject.io/docs/configuration/client#network_interface)
- don't overwrite this filed
- add new field in client config to let us using different interface during finger print
### Job file (if appropriate)
### Nomad Server logs (if appropriate)
### Nomad Client logs (if appropriate)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading client/fingerprint/env_aws.go and client/fingerprint/env_azure.go at the linked locations, then trace how client.network_interface and provider fingerprinting set unique.network.ip-address. Done means the configured interface value is not overwritten by the cloud-provider address, with the chosen behavior covering AWS and Azure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, azure, go
- Domain
- cloud, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100