13 ms·
My anti-kubernetes setup for small single servers is docker swarm, portainer & traefik. It's a setup that works well on low powered machines, gives you TLS (let
by mradmin 5y ago
My anti-kubernetes setup for small single servers is docker swarm, portainer & traefik. It's a setup that works well on low powered machines, gives you TLS (letsencrypt) and traefik takes care of the complicated network routing.
I created a shell script to easily set this up: https://github.com/badsyntax/docker-box https://github.com/badsyntax/docker-box
- GordonS 5y agoThis is exactly how I deployed my last few projects, and it works great! The only things I'd change are switching to Caddy instead of Traefik (because Traefik 2.x config is just so bewilderingly complex!), and I'm not convinced Portainer is really adding any value. Appreciate you sharing your setup script too.
- dneri 5y agoAbsolutely agree, I switched to Caddy recently and the configuration is considerably easier than Traefik. Very simple TLS setup (including self signed certificates).
- e12e 5y agoAfter some struggle I've managed to set up traefik with tags/docker socket so that services can "expose themselves" via tags in their service definitions - is there anything similar for caddy?
- mradmin 5y agoAgree the traefik config is a little complex but otherwise it works great for me. About using portainer, it's useful for showing a holistic view of your containers and stacks, but I also use it for remote deployment of services (Eg as part of CI/CD). I'll push a new docker image version then I'll use the portainer webhooks to redeploy the service, then docker swarm takes over.
- GordonS 5y agoAh, I wasn't aware of the web hooks, that sounds useful :)
- mradmin 5y agoHere's an example using GitHub Actions: https://github.com/badsyntax/docker-box/tree/master/examples/nginx-app#continuous-deployment-with-github-actions https://github.com/badsyntax/docker-box/tree/master/examples...
- kawsper 5y agoI have a similar setup, but with Nomad (in single server mode) instead of docker swarm and portainer. It works great.
- stavros 5y agoWhat does Nomad do for you, exactly? I've always wanted to try it out, but I never really got how it works. It runs containers, right? Does it also do networking, volumes, and the other things Compose does?
- heipei 5y agoWhat I like about Nomad is that it allows scheduling non-containerized workloads too. What it "does" for me is that it gives me a declarative language to specify the workloads, has a nice web UI to keep track of the workloads and allows such handy features as looking at the logs or exec'ing into the container from the web UI, amongst other things. Haven't used advanced networking or volumes yet though.
- stavros 5y agoSo do you use it just for scheduling commands to run? I.e. do you use `docker-compose up` as the "payload"?
- kawsper 5y agoYou send a job-specification to the Nomad API. There's different kind of workloads, I use Docker containers the most, but jobs can also run on a system-level, there's also different types of operating modes, some jobs can be scheduled like cron, where other jobs just exposes a port and wants to be registered in Consuls service-mesh. A job can also consist of multiple subtasks, an example could be nginx + django/rails subtasks that will be deployed together. You can see an example of a Docker job here: https://www.nomadproject.io/docs/job-specification#example https://www.nomadproject.io/docs/job-specification#example With a few modifications you can easily allow for blue/green-deployments.
- mrweasel 5y agoThat’s still a bit more than I feel is required. My problem is in the two to eight server space, but networking is already externally managed and I have a loadbalancer. It’s in this space I feel that we’re lacking good solution. The size is to small to justify taking out nodes for a control plane, but big enough that Ansible feels weird.