I have a cluster of 10 Swarm nodes started via docker swarm join
command
If i want to scale a docker instance to 15 via
docker service create --replicas 15
how does docker swarm know where to start the container?
is it round-robin or does it take into consideration of compute resource (how much cpu/mem being used)?
A Docker Swarm is a group of either physical or virtual machines that are running the Docker application and that have been configured to join together in a cluster. The activities of the cluster are controlled by a swarm manager, and machines that have joined the cluster are referred to as nodes.
Container-native load balancing is always used for internal GKE Ingress and is optional for external Ingress. The Ingress controller creates the load balancer, including the virtual IP address, forwarding rules, health checks, and firewall rules.
Docker swarm does not support the autoscaling concept. You need to use another solution for that, like docker-machine to create machines on your infrastructure and link these to the existing Swarm cluster.
Docker Swarm is not being deprecated, and is still a viable method for Docker multi-host orchestration, but Docker Swarm Mode (which uses the Swarmkit libraries under the hood) is the recommended way to begin a new Docker project where orchestration over multiple hosts is required.
When you create a service or scale it in the Swarm mode, scheduler
on Elected Leader
(one of the managers) will choose a node to run the service on. There are 3 strategies currently available to the leader.
The spread
and binpack
strategies compute rank according to a node’s available CPU, its RAM, and the number of containers it has. The random
strategy uses no computation. It selects a node at random and is primarily intended for debugging.
Under the spread
strategy, Swarm optimizes for the node with the least number of containers. The binpack
strategy causes Swarm to optimize for the node which is most packed.
Swarm uses spread by default.
Keep in mind you can Constraint
Containers on specific nodes too.
It's not possible to set strategies in docker version 1.12.1 (Latest release to posting date)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With