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

Proxy check default #4381

Merged
merged 3 commits into from
Jul 12, 2018
Merged

Proxy check default #4381

merged 3 commits into from
Jul 12, 2018

Conversation

banks
Copy link
Member

@banks banks commented Jul 12, 2018

Fixes #4301

If the managed proxy is bound to an unspecified address (0.0.0.0/[::]), default to 127.0.0.1.

Also adds a config mechanism to override that for more complex setups where loopback isn't the right option, and a way to disable the TCP check entirely should there be some reason it doesn't work for your topology.

Docs updated too (please proof read!).

banks added 2 commits July 12, 2018 12:57
… 0.0.0.0.

This also provides a mechanism to configure custom address or disable the check entirely from managed proxy config.
@banks banks requested review from mitchellh, mkeeler and kyhavlov July 12, 2018 12:10
Copy link
Member

@mkeeler mkeeler left a comment

Choose a reason for hiding this comment

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

Just the one question

}

// If we have a bind address and its diallable, use that
if bindAddr, ok := proxyCfg["bind_address"].(string); ok &&
Copy link
Member

Choose a reason for hiding this comment

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

Should we also make sure bindAddr is not a unix socket? Seems like it but I am not sure if we allow binding a proxy to a unix socket.

Copy link
Member Author

@banks banks Jul 12, 2018

Choose a reason for hiding this comment

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

I don't think it ever makes sense for the public listener on the proxy to be a unix socket. We may well add support for the private app => proxy listener being unix but this health check is always against the public socket so I think we are safe.

The TCP check is for the public port - i.e. is the service available to other instances in the cluster.

run a [TCP health check](/docs/agent/checks.html) against. By default this is
the same as the proxy's [bind address](#bind_address) except if the
bind_address is `0.0.0.0` or `[::]` in which case this defaults to `127.0.0.1`
and assumes agent can dial proxy over loopback. For more complex
Copy link
Member

Choose a reason for hiding this comment

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

"the agent"

Copy link
Contributor

@mitchellh mitchellh left a comment

Choose a reason for hiding this comment

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

Looks great.

I'm fine merging as-is, and this is probably fine, but we may want to consider using go-sockaddr in the future to check for the 0.0.0.0 and IPv6 equivalent rather than a string comparison. If we find edge cases or something.

@banks banks merged commit 9015cd6 into master Jul 12, 2018
@banks banks deleted the proxy-check-default branch July 12, 2018 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants