-
Notifications
You must be signed in to change notification settings - Fork 914
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
Registrator will not create consul services for the docker 1.12 service containers. #443
Comments
Currently, creation of services isn't exposed through events, so I don't think there's anything that can be done until docker provides such events. It looks like it's already on the roadmap, though: moby/moby#23827 |
What about rudimentary polling of: https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/3-8-services |
With Docker 1.13, services have the ability to publish ports in host mode (the same as with standalone containers). |
We are labeling containers (instead of services), with
`docker service create --container-label
SERVICE_80_NAME=wp-nginx-{{podId}}{{container_suffix}} ...`
this way our registrator can see it ;)
…On 1 February 2017 at 16:14, marcuslinke ***@***.***> wrote:
Probably I've overseen something but wouldn't it be possible to support
docker swarm labels at least? When a service is created this means some
containers are created / started and the appropriate docker events are
fired. If registrator could use swarm labels for service naming should'nt
it suffice?
docker inspect redis.1.8uj3q8o43vfe7b4nct99d4g3u
...
"Labels": {
"com.docker.swarm.node.id": "vpq694ms5z19r4ucn7qupj7xy",
"com.docker.swarm.service.id": "s1gbqnsivxi1yz0ihvan7epc1",
"com.docker.swarm.service.name": "redis",
"com.docker.swarm.task": "",
"com.docker.swarm.task.id": "8uj3q8o43vfe7b4nct99d4g3u",
"com.docker.swarm.task.name": "redis.1.8uj3q8o43vfe7b4nct99d4g3u"
}
...
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#443 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAX_M96c_cX3Z-afk2qEc5Txjj8UZhYGks5rYKFZgaJpZM4JHTTj>
.
|
@sitamet Solved my problem, thank you :-) |
Hi, I have registered service but heath check is failing, could you give me some directions ? I would like to register service to consul and be able to handle request to this service from fabio. Thanks in advance. |
anyone find a method to do this with @sitamet method
i get this in registrator :
|
@sulphur If you don't expose your ports to the host, run registrator with the option to register "the exposed" ports:
|
normally i expose them(unless i do it wrong :) ) i will try the internal that should fix my problem for non-exposed containers :) thanks |
dont work for me :( docker service create --name tomcat_PROD --container-label SERVICE_8030_NAME=tomcat_PROD -p 8030:8030/tcp --mount type=bind,source=/mnt/tomcat_PROD/conf,target=/opt/tomcat/conf --mount type=bind,source=/mnt/tomcat_PROD/redouteapps,target=/opt/tomcat/redouteapps --mount type=bind,source=/mnt/tomcat_PROD/logs,target=/opt/tomcat/logs --replicas=4 docker01:5000/centos_java8_tomcat8.5.16 |
with option -internal works, |
It looks like swarm events are now available as of Docker 17.06: moby/moby#23827 Having registrator pick up docker services would be extremely useful ! |
is registrator picking up docker services now? I faced the same issue as mentioned in this chain. When running as a docker container (using |
any update? |
Registrator seems to work if you use Docker compose file version 3.2 with the "long syntax" for ports. Addition of
|
@ionosphere80 Thanks! your solution works for me. But I am not able to understand why?? Does anyone know what is the default value of "mode" when we set it up normally like below.
Why does |
This mainly an issue related to the newest version of docker (docker 1.12) and the new version of docker swarm. It has most likely occurred because this project is not up to date with the experimental version of docker. The newest version of docker has a built in version of swarm that deploys containers as docker services. These containers are not directly connected to ports on the swarm worker nodes and as such are not discovered by registrator. Instead they require a docker network, which automatically load balances any containers of a service on a server through a single pre-defined port. So all the containers are essentially attached to the same port, but indirectly so. Right now registrator is not discovering either the containers or the load balanced port.
Here is an example for recreating a docker service that fails to be registered by registrator:
The text was updated successfully, but these errors were encountered: