Use Docker Swarm! Auto Deploy Script with Highly Available Storage - GlusterFS

  Рет қаралды 21,750

Jim's Garage

Jim's Garage

Күн бұрын

Docker Swarm is a great option to understand container orchestration, and might be the perfect choice for your homelab. It provides high availability and failover for services you are running. This is great to keep your favourite app running and is really useful when it comes to maintenance.
Docker Swarm Script:
github.com/JamesTurland/JimsG...
Docker Swarm Documentation:
docs.docker.com/engine/swarm/
Recommended Hardware: github.com/JamesTurland/JimsG...
Discord: / discord
Twitter: / jimsgarage_
Reddit: / jims-garage
GitHub: github.com/JamesTurland/JimsG...
00:00 - Overview of Docker Swarm & Benefits
04:12 - Script Walkthrough & VMs
15:26 - Swarm Deployment
18:10 - Checking It Works - Portainer
22:15 - Testing Failover & High Availability
24:25 - Outro

Пікірлер: 93
@PCMagikHomeLab
@PCMagikHomeLab 6 ай бұрын
Thanks to You I now understand Traefik and almost hole my lab is on docker with traefik. Next step docker swarm and kubernetes :) good job like always!
@Jims-Garage
@Jims-Garage 6 ай бұрын
That's awesome, thanks.
@chrisumali9841
@chrisumali9841 6 ай бұрын
@@Jims-Garage Which ubuntu 23.04 image did you specifically use? Just wondering? Is it this one (lunar-server-cloudimg-amd64.img) instead of (lunar-server-cloudimg-amd64-disk-kvm.img) Thanks
@Jims-Garage
@Jims-Garage 6 ай бұрын
@@chrisumali9841 cloud-images.ubuntu.com/lunar/current/lunar-server-cloudimg-amd64.img
@chrisumali9841
@chrisumali9841 6 ай бұрын
Thanks for the demo and info, Happy Holidays, and have a great day.
@Jims-Garage
@Jims-Garage 6 ай бұрын
Happy holidays!
@rayk32
@rayk32 6 ай бұрын
I am glad you and a few others (I found videos posted earlier this year) are talking about Docker Swarm. This technology should not be left behind because while Kubernetes has its place, it is overkill and unnecessarily complex for some applications. Docker Swarm and Gluster running on a clustered hypervisor is an awesome highly available solution. I hope your video brings a renewed interest in the continued development and support for Docker Swarm.
@Jims-Garage
@Jims-Garage 6 ай бұрын
Thanks, appreciate the kind words. I completely agree, Swarm is probably the sweet spot for homelab use.
@Narious324
@Narious324 11 күн бұрын
I completely agree. I've been using Docker standalone for a few years and recently upgraded to Docker Swarm with Gluster. I absolutely love it. I tried Kubernetes as well (K3S). I was able to setup Rancher with Longhorn for storage, but I wasn't loving it. It was overkill and extremely complex for what I wanted to do. While I won't be giving up on Kubernetes, I'm glad I went back and tried Docker Swarm after because I appreciated even more with how simple it is. I'm hoping that within a few years Kubernetes will become easier as innovations are introduced. Surely there will be improvements.
@markandrow4010
@markandrow4010 6 ай бұрын
Thank you, one of best in homelab, As always, excellent deployment process with detailed explanation.
@Jims-Garage
@Jims-Garage 6 ай бұрын
Very kind, thanks!
@randomguy3784
@randomguy3784 2 ай бұрын
Excellent walk through! 🎉
@Jims-Garage
@Jims-Garage 2 ай бұрын
Thanks
@DigiDoc101
@DigiDoc101 6 ай бұрын
Awesome video. Thank you for being thorough.
@Jims-Garage
@Jims-Garage 6 ай бұрын
Glad it was helpful!
@Jims-Garage
@Jims-Garage 6 ай бұрын
Glad it was helpful!
@neledwin
@neledwin 3 ай бұрын
Excellent, thank you!
@Jims-Garage
@Jims-Garage 2 ай бұрын
You are welcome!
@rayk32
@rayk32 6 ай бұрын
Great video! I want to do this in my VMware home lab.
@Jims-Garage
@Jims-Garage 6 ай бұрын
You should!
@martinking1019
@martinking1019 3 ай бұрын
Really like all of your videos, your home lab like how I want mine to be, with the exception of the Sophos firewall!! (turned my XG into a PFSense box) Except I'm using XCP-ng at the moment as it seems to be more in use in the commercial environment than Proxmox.
@Jims-Garage
@Jims-Garage 3 ай бұрын
Thanks. Both of those are solid alternatives, good work
@georgebobolas6363
@georgebobolas6363 6 ай бұрын
Hey Jim. I had used docker swarm long time ago and was really impressed. Too bad it faded out of fashion. As you said, it would be a very good fit for homelabs.
@Jims-Garage
@Jims-Garage 6 ай бұрын
Totally agree. It's super lightweight in comarison.
@nadpul
@nadpul 6 ай бұрын
Great video, been waiting for it for a while. A few questions/comments: - Why not use tail scale so all nodes would see each other and avoid opening ports across different geographic locations? - Why not use a proxmox container instead of the VMs? Any performance issues? - Why not create a container template and easily add a clone to the swarm? - What performance issues to expect with GlusterFS?
@Jims-Garage
@Jims-Garage 6 ай бұрын
Thanks :) 1) This cluster is local, VPNs are not required. 2) LXCs are notorious for causing problems with the overlay network. Plus, VMs are more secure than LXCs due to using a different kernel. 3) I used cloud-init for creating the nodes, I mentioned this and referenced the video I have on it. 4) GlusterFS isn't the most performant, but as the data is replicated on each node it should be sufficient. If you want performance you're better off with Ceph or Kuberenetes.
@kf4bzt
@kf4bzt 6 ай бұрын
Hey Jim, thanks for posting this. I haven't used docker swarm in a long time because I thought it wasn't support any longer but I will just back in and give it go again. Thanks for your hard work sir. I made try to redeploy this into a LXD service as well.
@Jims-Garage
@Jims-Garage 6 ай бұрын
Thanks. From everything I've heard LXC doesn't play nicely with the overlay network.
@testbox3201
@testbox3201 8 күн бұрын
​@@Jims-Garagejust set it up recently. The only thing is you have to enable ip forward for ingress routing....google docker swarm lxc....running nicely.
@E5SEFUSAR
@E5SEFUSAR 5 ай бұрын
Great stuff man thanks for sharing! Quick question though what if we have 3 proxmox nodes with ceph enabled and setup 3 docker managers and 3 workers on each of the proxmox nodes; from storage perspective do I need GlisterFS if I mount ceph using ceph-fuse package as a second storage for the VMs?
@Jims-Garage
@Jims-Garage 5 ай бұрын
Ceph is likely a better option, and especially now that glusterfs is being retired. I'm planning to move onto it later.
@neilcresswell6539
@neilcresswell6539 6 ай бұрын
You can have a 3 node cluster, with all 3 being managers/worker combo’s.. and you always need an uneven number of managers for quorum consistency.
@Jims-Garage
@Jims-Garage 6 ай бұрын
Thanks, Neil. That's good to know for people who want a 3-node setup.
@Vignesh.S.Naidu.
@Vignesh.S.Naidu. 4 ай бұрын
Yes that's exactly what I am looking for! Further I need a script similar to what was in video for 5 nodes, where can I find it?
@RamiKattan
@RamiKattan 6 ай бұрын
I tried following your kubernetes videos, ended with only nginx running, too complicated to go immediately after docker (sooner or latter I'll understand it better, but now right now). I will be trying this docker swarm very soon.
@Jims-Garage
@Jims-Garage 6 ай бұрын
Great, it's a good introduction into the world of container orchestration. Hop on Discord if you're stuck.
@yasaralzakout7691
@yasaralzakout7691 6 ай бұрын
Hi Jim, Thanks for the video. I have a question about portainer; since the free version supports 3 nodes only, did you buy a license to support 5 nodes? Or is it possible to support 5 nodes without purchasing a license?
@Jims-Garage
@Jims-Garage 6 ай бұрын
I use the community edition, there's no limit for nodes.
@AviDarks
@AviDarks 6 ай бұрын
Thanks for the excellent explanation. I have a question, after all the role of Docker Swarm is to continue work on another server. According to your video everything is done from one server. How to connect another server and install Docker Swarm
@Jims-Garage
@Jims-Garage 6 ай бұрын
As long as networks are routable and the right ports are open, nodes can be on different machines and networks.
@Chalker633
@Chalker633 6 ай бұрын
Hey Jim. I get it, Docker Swarm benefits with a number of worker nodes and all that jazz, sure. But probably, I'm missing some distinctive detail, the most important thing - what are the benefits of a virtual cluster, whose nodes resides on the same physical server? How this HA setup will benefit, for example, when file system starts to fail or some RAM issues occurs on the physical server itself? Or are these kind of setup designed to solve other problems, not related with some hardware issues?
@Jims-Garage
@Jims-Garage 6 ай бұрын
Hey, you raise a valid point. There's less point on the same machine, but if you've watched my Kubernetes videos you will know that I split between physical Proxmox nodes. This gives all of the benefits you are asking about. On the same machine, the best use is that you can reboot the VM for updates without breaking your services.
@Chalker633
@Chalker633 6 ай бұрын
@@Jims-Garage Turns out, I learned something, huh. Thank you for your videos and this clarification.
@apmellott
@apmellott 2 ай бұрын
@Jims-Garage I for the life of me can't get this to work. It's a great script, but I can't get the SSH auth to work properly. I get a permission denied error whether I use the public key from the Proxmox host or the "admin" VM. I do have a SSH public key for my laptop as part of the cloud-init process. That could be the problem but I'm pretty green with Linux. I don't want to manually run the install process from the script but that's where I'm at now. Help please...
@Aruneh
@Aruneh 6 ай бұрын
Gluster is basically end-of-life (in a year) so I wouldn’t base a new setup on it, I think there are better options. It also has terrible performance in my experience, but that might be related to the amount of data.
@Jims-Garage
@Jims-Garage 6 ай бұрын
I agree, there are more performant options, but it's a good option to get started. I'll look to replace glusterfs in the future.
@sphbecker
@sphbecker 6 ай бұрын
⁠@@Jims-Garage it isn’t really a matter of performance. Just like you wouldn’t install Windows 7 on a new computer, you shouldn’t build a new setup using Gluster. It’s fine to keep using it if you already are, but don’t invest energy into building on it.
@Vignesh.S.Naidu.
@Vignesh.S.Naidu. 4 ай бұрын
Oh really, I was about to setup my own Now! Is there a suggestion for me? Which one should I go for in docker swarm if not glusterfs?
@raymerp9
@raymerp9 3 ай бұрын
​@@Jims-Garage First, thanks for a great video! In the process of setting up something new, do you have suggestion(s) for an alternative to Glusterfs for a hybrid CPU (arm, amd, etc) set up? Maybe BeeGFS?
@Jims-Garage
@Jims-Garage 3 ай бұрын
@@raymerp9 thanks, sadly not anything I have experience with as I'm x86
@cbaservs
@cbaservs 4 ай бұрын
thank you Jim i have a question concerning the certificates i have a 5 server cluster and want to spread the load over the several servers ergo than i need all 5 different certificates to be specified or can i use only one from my proxmox cluster master?
@Jims-Garage
@Jims-Garage 4 ай бұрын
The best way is perhaps to generate your own key and use that. Otherwise, create on a single host and then migrate the VMs. Should honour the original key.
@cbaservs
@cbaservs 4 ай бұрын
@@Jims-Garage thank you again Jim and will do the second option you suggested but first need to create 5 cloud-init servers...thank you for that tutorial too
@75634653
@75634653 5 ай бұрын
Hey Jim. I was wondering if it's possible to run something like gluetun and qbittorrent in swarm. I can't seem to get it working. I tried using the shadowsocks proxy that comes with gluetun but cannot seem to get it working. Either way thanks fora great video :) Subscribed
@Jims-Garage
@Jims-Garage 5 ай бұрын
Thanks, it should certainly be possible but I haven't done it I'm afraid. I use Kubernetes
@luigitech3169
@luigitech3169 6 ай бұрын
Cool, does GlusterFS work also with databases? Do you need to turn off the cluster to do system updates?
@Jims-Garage
@Jims-Garage 6 ай бұрын
It should work with databases with replicas set to 1. As with all databases it's recommended to backup using database tooling, and if you can't you should then stop the service first.
@zippi777
@zippi777 15 күн бұрын
As always.....Good job man! I have a question: When I have configured everything as in this video, can I then install a Docker application directly using Portainer and I will have all the benefits such as HA etc? Second thing: have you ever seen SWARMPIT? Maybe you've already seen it but it looks like a very nice GUI to "handle" all the Docker Swarm! What do you think?
@Jims-Garage
@Jims-Garage 15 күн бұрын
Yes, installing via Portainer will give you the benefits of swarm. I haven't used swarmpit as I find Portainer to be perfect.
@zippi777
@zippi777 4 күн бұрын
@@Jims-Garage OK, great, but can I use a docker compose yml file as if I installed the application on "single" docker or do I have to make some changes in the yml file? I see that Portainer when I create a new stack asks me where I want to install it for example on Worker-1... is that enough? Thanks again for your patience!
@scubeedu2
@scubeedu2 2 ай бұрын
I've set this up in a test lab with a 3-node manager cluster and use NFS as the central storage for volumes. Works great in my testing, but now I'm wondering how easy it would be to migrate an existing standalone environment into the cluster? Any comments on this aspect?
@Jims-Garage
@Jims-Garage 2 ай бұрын
Should be a case of copying the data over and amending the deployment yaml. Should be easy to do.
@scubeedu2
@scubeedu2 2 ай бұрын
@@Jims-Garage OK, but is that just for stacks or does that apply to containers as well? I'm testing "SnapDrop" right now which was created as a container; it does not seem to replicate like stacks do. Would I need to deplay everything using a stack? Actually, I just discovered that you need to add these as a "Service" so that you can then indicate whether they are Global or Replicated. My SnapDrop test is working great now. Thanks for your awesome video - docker swarm is still useful for the homelab, that's for sure!!!
@Jims-Garage
@Jims-Garage 2 ай бұрын
@@scubeedu2 you need to deploy using the swarm yaml template. It looks a little different to a standalone deployment.
@NikolaNovoselec
@NikolaNovoselec 6 ай бұрын
I’m adding this to the watchlist to check out later. Is this viable for homelab deployment? Everyone seems to suggest k3s lately.
@Jims-Garage
@Jims-Garage 6 ай бұрын
If you have the time and resources then k3s (or preferably RKE2 - I have a video) is better. However, docker swarm is a viable option for a homelab that is far simpler and does most of what you'd want.
@NikolaNovoselec
@NikolaNovoselec 6 ай бұрын
I have checked out your RKE2 video yesterday. Very nicely explained how to set it up, thank you. But it seems too resource intensive for a small homelab. I like docker and the simplicity of it, if it can be set up for HA and LB I think I’d give it a go.
@Jims-Garage
@Jims-Garage 6 ай бұрын
@@NikolaNovoselec swarm will give you that
@GamerPlaya12
@GamerPlaya12 10 күн бұрын
Could you explain how to fit traefik into this docker swarm setup?
@Jims-Garage
@Jims-Garage 10 күн бұрын
I'll likely come back to swarm in the near future.
@JohnWeland
@JohnWeland 5 ай бұрын
Finally tried to take this on today (2 Node Proxmox/CEPH). I tried with cloud image VM and they just hang on the -serial0 message when loading up the console. Tried with LXC containers, they will spin up and I can manually install docker and such, but the script from github appears to work, hangs a bit prompts me for sudo but the password appears in plain text and you have to ctrl+c to terminate. So I am going to go to bed and try again in the morning.
@Jims-Garage
@Jims-Garage 5 ай бұрын
Let me know how you get on
@JohnWeland
@JohnWeland 5 ай бұрын
@@Jims-Garage after I said I was going to bed, I kept at is. No luck with VMs but in LXC containers they cannot be “unprivileged” or you cannot create the volume. I seem to have everything working except the mount itself. I was able to write to fstab, but the actual “mount.glusterfs … /mnt” returns a mount failed error. So that’s the next rabbit hole to dive into. And then of course back tracking to figuring out the VM side of things I wonder if it’s the issue you faced in the stream with the kvm image (I haven’t watched that yet) but my next order of trouble shooting it to you the regular cloud image.
@JohnWeland
@JohnWeland 5 ай бұрын
@@Jims-Garage came back to it. I have it working on Proxmox VM's now. 3 managers 3 workers. might add 3 more workers (1 manager 2 workers per Proxmox nodes? maybe? )
@RyanMeray
@RyanMeray 3 ай бұрын
With the news of RH dropping support for Gluster, do you still think this is a viable path to start on if one is about to deploy a network storage solution from scratch?
@Jims-Garage
@Jims-Garage 3 ай бұрын
No. I'd look into ceph for now (albeit Kubernetes is perhaps where you might want to be)
@RyanMeray
@RyanMeray 3 ай бұрын
@@Jims-Garage Ugh, those both sound way above my skill level. Thanks for the gut check though!
@Jims-Garage
@Jims-Garage 3 ай бұрын
@@RyanMeray if you simply want to play with swarm and learn fundamentals this will be fine. It's just not something I recommend building around.
@RyanMeray
@RyanMeray 3 ай бұрын
@@Jims-Garage My goal is to set up a HA 5-node cluster for file storage and backup. Looking like Proxmox VE with CEPH may check the boxes, I'll just have a lot of learning ahead.
@testbox3201
@testbox3201 8 күн бұрын
Why not using three managers who also will do workloads?
@Jims-Garage
@Jims-Garage 8 күн бұрын
It's good practice to split them out, but for a homelab it's probably okay to amalgamate.
@testbox3201
@testbox3201 8 күн бұрын
@@Jims-Garage yes, you're right about best practice, my question was focused on homelab usage.
@tonychia2227
@tonychia2227 5 ай бұрын
how to setup 5 nodes with proxmox ?
@Jims-Garage
@Jims-Garage 5 ай бұрын
Check my Kubernetes video on cloud-init. That will show you how to create multiple VMs quickly.
@-rm-rf
@-rm-rf 6 ай бұрын
first xD
@Jims-Garage
@Jims-Garage 6 ай бұрын
My hero 😻
@mithubopensourcelab482
@mithubopensourcelab482 6 ай бұрын
GlusterFS performance is pathetic even after allocating a separate physical network for its brick. Secondly, its quite heavy on processor. I would certainly look into any other fs giving similar features.
@Jims-Garage
@Jims-Garage 6 ай бұрын
Local performance seems acceptable though?
@krlospatrick
@krlospatrick 3 ай бұрын
I am curious, do you have any benchmark available? Would NFS be a better solution?
Proxmox Backup Server Saves You Money And Time!
24:48
Jim's Garage
Рет қаралды 42 М.
She ruined my dominos! 😭 Cool train tool helps me #gadget
00:40
Go Gizmo!
Рет қаралды 59 МЛН
Docker vs Kubernetes, what's better in a Homelab?
14:57
Christian Lempa
Рет қаралды 79 М.
Using docker in unusual ways
12:58
Dreams of Code
Рет қаралды 408 М.
Simple RKE2, Rancher and Longhorn Install
13:21
Andy Clemenko - Firefighter Geek
Рет қаралды 20 М.
Become a Docker Swarm Expert in just 20 minutes
20:51
Akash Kumar
Рет қаралды 15 М.
SMB Server In Docker with ZFS! Simple, Cheap, and Efficient!
23:00
Jim's Garage
Рет қаралды 42 М.
Is it time to switch from Docker to Podman?
16:05
Christian Lempa
Рет қаралды 220 М.
Meet netboot.xyz - Network Boot Any Operating System
25:00
Techno Tim
Рет қаралды 724 М.
cute mini iphone
0:34
승비니 Seungbini
Рет қаралды 5 МЛН
Lid hologram 3d
0:32
LEDG
Рет қаралды 8 МЛН
iOS 18 vs Samsung, Xiaomi,Tecno, Android
0:54
AndroHack
Рет қаралды 92 М.
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 2,1 МЛН
Игровой Комп с Авито за 4500р
1:00
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 869 М.