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

[consul] Ensure we always bind to the instance's main private IP #813

Open
gozer opened this issue Jul 17, 2018 · 0 comments
Open

[consul] Ensure we always bind to the instance's main private IP #813

gozer opened this issue Jul 17, 2018 · 0 comments

Comments

@gozer
Copy link
Contributor

gozer commented Jul 17, 2018

This is something we have done in CI, when dealing with docker's extra local interfaces, so somthing like:

#!/bin/bash

IP_ADDR=$(curl --retry 60 -fks http://169.254.169.254/latest/dynamic/instance-identity/document | jq .privateIp' -r)

# Multiple IPs cause consul to have issues, specify which to bind to
if [ "${IP_ADDR:-0}" != "0" ]; then
cat << EOF | tee /etc/consul/bind.json
{
  "bind_addr": "${IP_ADDR}"
}
EOF
fi

Would to the trick

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

No branches or pull requests

1 participant