Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use an interface name to find the bind addr for rpc, http and serf components #941

Merged
merged 8 commits into from
Mar 21, 2016

Conversation

diptanu
Copy link
Contributor

@diptanu diptanu commented Mar 19, 2016

This PR allows the operators to specify an interface name which Nomad will use to find an IP address and use it for the http service, serf and rpc.

For example, with the following configuration -

interfaces {
   http = "eth2"
   serf = "eth0"
   rpc = "eth0"
}

Nomad will find the IPs configured for each of the network interfaces and use one of the IPs for binding the network services. IPv4 addresses are given preference over IPv6

switch v := (addr).(type) {
case *net.IPNet:
ip = v.IP
if ip.To4() != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think there is any merit in ignoring the loopback IP here? Binding to a loopback IP does not make sense since no one else can access it. This might help if the user mistakenly puts something like lo0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@achanda This is an operator(sysadmin) setting. We trust the operator to do the right thing.

@@ -255,6 +259,12 @@ type Addresses struct {
Serf string `mapstructure:"serf"`
}

type Interfaces struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throw some comments on these

@dadgar
Copy link
Contributor

dadgar commented Mar 20, 2016

LGTM

@dadgar
Copy link
Contributor

dadgar commented Mar 20, 2016

Also documentation for the website

diptanu added a commit that referenced this pull request Mar 21, 2016
Use an interface name to find the bind addr for rpc, http and serf components
@diptanu diptanu merged commit 7e1e8a4 into master Mar 21, 2016
@diptanu diptanu deleted the f-interface-name branch March 21, 2016 06:57
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants