Comments (7)
I have a similar problem about the registrator's IP is filled into the container's IP.
from registrator.
For etcd, the workaround at the moment is to use the -internal
flag. While the documentation states it will use the docker0
interface IP, it actually registers the container IP address.
from registrator.
is there a workaround if you're using consul? I only want to allow my containers to discover the service on another container within the same host. I only have 1 host
from registrator.
I also tested the Registrator on consul, and see the same issue. The following is the string rendered from a haproxy template file for servers:
baseStr="server ci05:mad_archimedes:8085 172.17.2.121:49226 check"
The ip address 172.17.2.121 is the docker container internal ip address, not the native host, which is ci05, IP address. So I created a python script to parse this line, use dig to query the IP address for ci05, and replace the IP address to create the following new line for the above line
server ci05:mad_archimedes:8085 172.20.2.147:49226 check
Using consul-template, once the consul template file get rendered, run a script like the following to fix the IP address in the Haproxy cfg file, before restarting Haproxy.
Use the following regex to test haproxy server config lines
serverRegex=re.compile('\ server . .* check\ *')
Use the following loop to scan the haproxy cfg file, and fix the IP address in the server setting line.
with open(haproxy.cfg) as f:
for line in f:
line=line[:-1]
m=serverRegex.match(line)
if m:
newline=fix_addr(line)
print newline
else:
print line
The server setting lines get fixed, printed without the leading spaces as in the original haproxy.cfg file.
This "plugin script to fix config files" after template rendering are applicable for fixing similar issues, not limited to the ip address issue reported here for Registrator.
from registrator.
Does someone has test the -internal parameter with consul registry since 856084a ?
It seems it doesn't work as intended, I'm still getting the host IP instead of container IP.
from registrator.
Same here.
I'm running a CoreOS cluster with Flannel Networklayer and want Registrator to push all ContainerIPs to Consul respecting all Ports exposed in the Dockerfile.
Because of the internal virtual network which connects all containers i use -p
only to expose Ports to the public World.
from registrator.
The latest version resolves this when using -internal
for both etcd and Consul.
from registrator.
Related Issues (20)
- Not able to get POD IP for registration in EKS
- unsupported protocol scheme ""
- Cannot unmarshal number into Go value of type string HOT 1
- Support for newer versions of Consul HOT 10
- Support for 3.x version of etcd HOT 2
- Dead link in website
- cannot connect to Docker endpoint
- Unregister on 'stop'
- Health checks with SERVICE_CHECK_SCRIPT doesn't work HOT 1
- Possible bug (or by-design behavior) of using IPv6 addresses to register TCP health check to `Consul`?
- http://gliderlabs.com/ is down HOT 1
- Image docker.io/gliderlabs/registrator:latest uses outdated schema1 manifest format HOT 2
- Require image for ARM64 architecture HOT 3
- gliderlabs.com is down HOT 1
- All service names start with sha265 when containers are started with the new compose-cli HOT 3
- Takeover the project HOT 7
- I would like to add support for excluding some containers
- Not an issues | Registrator Updated / Fork HOT 2
- Fork of this project and an open invitation to participate. HOT 1
- Registrator not picking the events everytime
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from registrator.