Comments (5)
I will just save everyone a TON of time. Ingress default creation is the problem here. Every service you start up connects to your created network and the ingress
network. The default for the ingress network is /24
. That means if all of your services are exposed to the ingress network, you can have at most 254 services in your swarm created. These assignments to the ingress network don't get recycled (bug...but I noticed until a manager restart).
This can be tested by launching a swarm with docker swarm init --default-addr-pool 10.0.0.0/8 --default-addr-pool-mask-length 28
. It creates the ingress network with mask length /28
, which means only 14 service connections can be created. You will hit this issue almost immediately. It's a good reproduction scenario.
Keep in mind if one wants to reduce the number of ip address assigned by default on network create then you can set the mask length parameter of the swarm, then remove the ingress network, and recreate it with subnet 10.0.0.0/16
which will then allow 65534 service connections to the ingress, while keeping your default allocation of /28
for example for all networks created.
Thumbs up if this helped!
from dockerswarm.rocks.
In my environment, we solved this by creating more networks and linking to traefik, so we could use another 256 available addresses for each network created;
Example:
traefik-docker-compose.yml
version: '3.3'
networks:
webgateway:
driver: overlay
ipam:
driver: default
config:
- subnet : 192.168.1.0/24
webgateway_2:
driver: overlay
ipam:
driver: default
webgateway_3:
driver: overlay
ipam:
driver: default
webgateway_4:
driver: overlay
ipam:
driver: default
services:
traefik:
image: "traefik:v2.1.3"
command:
- "--ping=true"
- "--ping.entryPoint=ping"
- "--providers.docker.swarmMode=true"
- "--providers.docker.network=traefik_webgateway"
- "--providers.docker.network=traefik_webgateway_2"
- "--providers.docker.network=traefik_webgateway_3"
- "--providers.docker.network=traefik_webgateway_4"
- "--providers.file.directory=/configuration"
- "--providers.file.watch=true"
- "--entryPoints.web.address=:80"
- "--entryPoints.web.forwardedHeaders.insecure"
- "--entryPoints.websecure.address=:443"
- "--entryPoints.websecure.forwardedHeaders.insecure"
- "--entryPoints.ping.address=:8082"
- "--api.dashboard=true"
- "--api.insecure=true"
- "--metrics=true"
- "--metrics.prometheus=true"
- "--accesslog=true"
networks:
- webgateway
- webgateway_2
- webgateway_3
- webgateway_4
ports:
- "443:433"
- "80:80"
- "8080:8080"
- "8082:8082"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /root/traefik/configuration/:/configuration/
deploy:
restart_policy:
condition: any
delay: 5s
mode: global
placement:
constraints:
- node.role == manager
labels:
- traefik.enable=false
my api.yml 1:
version: "3.8"
networks:
traefik_webgateway:
external: true
services:
web:
image: myservicename
command: ["node", "server"]
environment:
- TZ=America/Sao_Paulo
networks:
- traefik_webgateway
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 5s
labels:
- "traefik.docker.network=traefik_webgateway"
- "traefik.http.routers.myservicename.rule=Host(`service.example.com`)"
- "traefik.http.routers.myservicename.entrypoints=web"
- "traefik.http.routers.myservicename.service=myservicename"
- "traefik.http.services.myservicename.loadbalancer.server.port=3335"
my front.yml after 256 services:
version: "3.8"
networks:
traefik_webgateway_2:
external: true
services:
web:
image: myfront
command: ["node", "server"]
environment:
- TZ=America/Sao_Paulo
networks:
- traefik_webgateway_2
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 5s
labels:
- "traefik.docker.network=traefik_webgateway_2"
- "traefik.http.routers.myfront.rule=Host(`myfront.example.com`)"
- "traefik.http.routers.myfront.entrypoints=web"
- "traefik.http.routers.myfront.service=myfront"
- "traefik.http.services.myfront.loadbalancer.server.port=8080"
from dockerswarm.rocks.
As I understand dnsrr solve this problem but it does not support with traefik right now traefik/traefik#3288
from dockerswarm.rocks.
Thanks for reporting back and closing the issue 👍
from dockerswarm.rocks.
As I understand dnsrr solve this problem but it does not support with traefik right now traefik/traefik#3288
dnsrr works for me with the latest version of Traefik and Docker
from dockerswarm.rocks.
Related Issues (20)
- Swarmpit setup fails - http://db:5984 host unreachable HOT 4
- Service placement on different node makes it unreachable HOT 2
- Swarmpit on ARM HOT 1
- Let's encrypt issue HOT 2
- Setting up hostname didn't work
- 404 for grafana / prometheus requests HOT 2
- Traefik example and its labels HOT 1
- Suggestion: Start with simple stack to get Portainer running with Caddy HOT 2
- Traefik on 2 Manager Nodes HOT 4
- What are the things to look when traefik.<domain name> is not loading? HOT 2
- Any recommended FOSS projects for Docker Swarm Mode deployments? HOT 3
- Traefik : redirect all http to https HOT 4
- n/a
- nginx loadbalancer
- Custom SSL Certificate HOT 3
- [feature request] dark mode for dockerswarm.rocks HOT 1
- Traefik redundancy and DNS configuration HOT 3
- Feature Request: Explain the roles of Portainer and Swarmpit (better) HOT 1
- Is dockerswarm.rocks still maintained? HOT 14
- Everything depends on the first node despite being in swarm mode HOT 2
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 dockerswarm.rocks.