41 ms·
Isn't that functionality already buried somewhere between Docker Stack and Docker Swarm?
by intelVISA 4y ago
Isn't that functionality already buried somewhere between Docker Stack and Docker Swarm?
- skor 4y agoyeah, and docker swarm on a single node is not overkill at all. plus, don’t need to install anything. Sure you have just one manager but with one node you don’t need to worry about quorum, if it goes down then that’s that.
- arynda 4y agoany chance you have a link to a good readme on setting up single-node docker swarm?
- skibbityboop 4y ago1. Install regular old Docker 2. Type 'docker swarm init' 3. There is no 3, you're literally finished and now have a full-on Swarm node w/ all features.
- dijksterhuis 4y agothe docker docs are actually pretty good. general intro https://docs.docker.com/engine/swarm/ https://docs.docker.com/engine/swarm/ step by step tutorial https://docs.docker.com/engine/swarm/swarm-tutorial/ https://docs.docker.com/engine/swarm/swarm-tutorial/ ^ takes you through a 3 server setup and deploying services via the CLI rather than a docker "stack" file, which is basically a compose file with the ability to set additional deployment specific properties. just set up the one manager and skip anything about additional worker nodes or draining nodes. for docker stack files -- see the docker compose v3 reference but take heed of any `docker stack deploy` caveats in the compose documentation. anything about docker stack deploy` is "stack file" territory. https://docs.docker.com/compose/compose-file/compose-file-v3/ https://docs.docker.com/compose/compose-file/compose-file-v3... compose file v3 is being depreciated this year, with a new specification aiming to unify the two. but it gives you an idea of the historical differences between old `docker-compose up` and `docker stack deploy` (swarm).
- notpushkin 4y agoI love this set of guides: https://dockerswarm.rocks/ https://dockerswarm.rocks/ Shameless plug: I'm also developing a GUI for Docker Swarm, if you don't feel like fiddling with command line too much: https://lunni.dev/ https://lunni.dev/ The getting started guide will walk you through setting up a single-node Docker swarm from a clean Debian / Ubuntu install: https://lunni.dev/docs/install/ https://lunni.dev/docs/install/
- KronisLV 4y ago> I'm also developing a GUI for Docker Swarm, if you don't feel like fiddling with command line too much: https://lunni.dev/ https://lunni.dev/ This seems like a cool idea, I wish you the best of luck! I will, however, also link Portainer, which I've used for both Docker Swarm and Kubernetes management: https://www.portainer.io/ https://www.portainer.io/ It does basically everything you might want (it even gives you redeployment webhooks, which will make new containers be pulled, if you enable them), with the caveats that they're focusing a lot on adding paid functionality nowadays and infrequently you might have connectivity issues, which a redeploy of Portainer will fix. I've also heard of and used Swarmpit a while back: https://swarmpit.io/ https://swarmpit.io/ When I did use it, however, it did feel a little bit broken in places and the experience wasn't quite as smooth as Portainer was (also, for whatever reason, it seemed to give me back different YAML than the one that I had last deployed, maybe generating it on the fly?). No idea what was up there, but the UI was pleasant regardless. So I think it'd be pretty cool if someone were to borrow the ideas that work from either those as inspiration for their own tool! :) On the CLI, there's also ctop, which is nice for inspecting the current containers on a node, even if it doesn't really have much to do with Swarm: https://ctop.sh/ https://ctop.sh/
- notpushkin 4y agoThank you so much! Lunni actually uses Portainer as a backend right now. Portainer is a very powerful tool, a Swiss army knife of sorts, but I find the UI a bit complicated. (That's actually one of the reasons I started Lunni!) E. g. to deploy a new stack, you've got to wait for environment list to load, select an environment, go to Stacks, wait for stack list to load and only then click New stack. In Lunni that is one click away from the dashboard. Swarmpit is also pretty nice, but yeah, broken in a couple ways. The quirk you encountered is actually pretty easy to explain: I think old versions of Swarmpit didn't store the YAML, but reconstructed it from the current stack state. It's actually pretty neat: if you deploy something outside of Portainer, it will complain that it doesn't know this stack and won't let you update it. Swarmpit however would show you what YAML could produce this stack, so you have at least something to work with. I might borrow this idea at some point, too :-)
- szastamasta 4y agoYeah, looks like a “poor man” docker swarm. And I would just go with swarm. It’s very good. And very easy to move to from compose. Too bad k8s won the hype battle here.
- dawnerd 4y agoPeople get scared away from swarm because they make it sound like you NEED 3 managers minimum. This simply isn't true and it runs great even on a single node. I've moved all of my production and stage environments to be swarm based. I just wished there was an easier way to have file-shares between nodes. Makes running a reverse proxy like traefik tricky.
- ancieque 4y agoYou may like the new release of moby 23.0.0 then :) see https://docs.docker.com/engine/release-notes/23.0/ https://docs.docker.com/engine/release-notes/23.0/ the community is working on adding Swarm support to CSI vendors: https://github.com/olljanat/csi-plugins-for-docker-swarm https://github.com/olljanat/csi-plugins-for-docker-swarm
- moqmar 4y agoTBH, to me Swarm always feels like something way more complex than Compose, but also way less flexible than Kubernetes. For most people, I guess they either want simplicity, or a full flexible cluster with a great ecosystem.
- pankarol 4y agoSwarm has some limitations, I outlined them here: https://www.reddit.com/r/docker/comments/10w7pfs/comment/j7lpwsu/ https://www.reddit.com/r/docker/comments/10w7pfs/comment/j7l... I’ve seen docker compose deployments where the only missing part was the ability to replace the container without downtime. Swarm would also solve this problem, but it won’t always be as simple as redeploying the stack in swarm mode, especially if you rely on `docker-compose run` in your deployment process.
- skor 4y agofor the case of docker compose run I do this: have a service that runs, does something, then terminates and isn't restarted (see docs). We do migrations and other one off things with that.