docker stack deploy from compose file - all services one node?

∥☆過路亽.° 提交于 2019-12-12 04:57:30

问题


I have a docker-compose file with 10 services (containers). I have it configured one instance of each server.

When I execute the stack deploy, all 10 services go to one node (manager).

I trust that adding a second instance of a service will distribute it, but I want my 10 unique services distributed.


回答1:


If you are using a private registry its important to share the login and credentials with the worker nodes by using

docker stack deploy --with-registry-auth



回答2:


Don't have the reputation to comment but...

If you are using a private registry that requires a ca certificate --with-registry-auth alone doesn't seem to work. You need to install the ca certificate to each node.

We are using Harbor but I guess that's not that relevant.

In my case I had to do something like:

sudo mkdir -p /etc/docker/certs.d/10.10.1.5
sudo cp ca.crt /etc/docker/certs.d/10.10.1.5/.

It's really quite obvious but I spent quite some time on this and decided to share.



来源:https://stackoverflow.com/questions/46242133/docker-stack-deploy-from-compose-file-all-services-one-node

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!