Skip to content
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

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

Open
JiangJungle opened this issue Sep 4, 2022 · 4 comments
Open

Comments

@JiangJungle
Copy link

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!

@bluepuma77
Copy link

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

@JiangJungle
Copy link
Author

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。

@s4ke
Copy link
Contributor

s4ke commented Sep 9, 2022

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

@ieugen
Copy link

ieugen commented Jan 24, 2024

@JiangJungle :

replica = 1 and max_replicas_per_node = 1

and also make sure you use stop-first update order

If you are satisfied with the answers, please close the issue.
You might also fix this application wise like it was mentioned above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants