moby / swarmkit

A toolkit for orchestrating distributed systems at any scale. It includes primitives for node discovery, raft-based consensus, task scheduling and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I create a container without replica concept in swarm cluster

JiangJungle opened this issue · comments

In the Swarm cluster, I can only create a container with the concept of replica, which is called service, or use docker run to start a local container.

I want to create a container in the swarm cluster. This container can't expand replicas and can be dispatched to any node in the cluster. The docker run command can only start the container locally, and the swarm service can change the number of copies at will. These are not what I want.

Please tell me what I should do, thank you!

What's wrong with having replica=1? Swarm wouldn't just increase that number.

What's wrong with having replica=1? Swarm wouldn't just increase that number.

I can only have one container, otherwise my application cluster will have problems. I must prevent the swarm service replica from being changed。

If this is really important to you, I suggest looking into solutions like https://github.com/ybrs/single-beat and handling this on the application side