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

FR: Multiple Hosts Support #1902

Open
spyhuntergenral opened this issue Jan 16, 2024 · 12 comments
Open

FR: Multiple Hosts Support #1902

spyhuntergenral opened this issue Jan 16, 2024 · 12 comments

Comments

@spyhuntergenral
Copy link

Is your feature request related to a problem? Please describe.

Related to #1218 seems like that one ended in hurt feelings.

In any case opening this FR again, as its not an edge case,

Currently when setting the "DOCKER_HOST" variable to a remote sock endpoint i.e "tcp://1.1.1.1:2375" watchtower shifts from watching the localhost to the specified remote host correctly.

Describe the solution you'd like

Would i be terribly difficult to implement passing this variable as a comma separated array? i.e DOCKER_HOST: "tcp://1.1.1.1:2375,tcp://2.2.2.2:2375"

In a similar manner to how Dozzle works see: https://dozzle.dev/guide/remote-hosts

Ideally additionally when setting this variable it would still monitoring the localhost in addition to all the remote hosts passed.

The goal would be to remove the need to have a watchtower instance running on every single container host and have 1 watchtower instance updating containers across X many hosts (both local and/or remote)

Describe alternatives you've considered

Moving away from watchtower :(

Additional context

No response

Copy link

Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏

@cameronaw13
Copy link

cameronaw13 commented Feb 1, 2024

+1 on this.
Just to clear the air from the previous discussion; from what I've gathered, I think that both piksel and simskij severely misinterpreted what neo-neo1 was trying to say. He was not asking for a way to implement redundancy for watchtower but was instead commenting on how redundant it is to add a new instance of watchtower for each and every machine he runs docker on. Instead, as spyhuntergenral suggests, we could allow a single instance of watchtower to update multiple remote Docker endpoints (including the local daemon if possible) eliminating the need to start up and maintain multiple instances of watchtower.

@cameronaw13
Copy link

After briefly reviewing the internal/pkg code and docker sdk api, it seems that we'd need to rework quite a bit regarding the client setup process. There isn't any way to add multiple hosts directly through the "DOCKER_HOST" env var as its used directly in the sdk api (it can only work with one host at a time). We'd likely need to add a separate environment variable allowing us to parse and iterate through a list of docker hosts (though this may add unneeded complexity). For each iteration we would need to run the update stack changing the docker_host env var each time but I am unsure of how much would need to be updated in order to accommodate this. For example, we'd also need to rework notifications/logs allowing you to differentiate between docker hosts.

And there's likely much more that I missed as I only looked through the code briefly with my limited golang knowledge. Its a bit more complicated than I first thought but I still feel that implementing such a feature would benefit many people's setups including mine in the long run.

@NetRat88
Copy link

Good to see, that this FR comes up again.
I also was searching for the possibility to add multi host on my existing and running watchtower instance and also was wandering about the discussion in the past. 😅

In my use case I would like to add my QNAP NAS docker host with paperless, another Raspberry Pi4 with some network docker containers and my Pi5 with home automation containers to my existing watchtower instance in my third management Pi (with Portainer and some other containers).

Just to let you guys know that there are more supporters for this feature request. Thanks for the great work which saves me a lot of admin time!
But understand that you have iterate some more code to add this. I also use pushover notifications and could imagine, that it's not just extending the remote host list.

@ThrustVector
Copy link

Ended up here after searching for exactly this feature. Seems I have to resort to one instance of Watchtower per Docker host for now 😥

@ollioddi
Copy link

+1 for this.

I run a couple of proxmox nodes, with vms/lxc for docker for contained services.

Each vm/lxc usually runs 2-6 containers each. I don't really care about the resource usage, it's more about centralizing an overview.

Instead of doing the docker socket remotely, an "agent" based approach could perhaps be considered?

Like portainer, or crowdsec, a lightweight container could be deployed on whatever node, which then communicates with a main instance.

@markhaines
Copy link

@ollioddi would also be interested in this approach

@mauromortier
Copy link

mauromortier commented Jan 6, 2025

+1 for this feature. I too am running multiple LXC's with each a few dockers. It is possible to set this up on each instance but that's a lot of work and i'd have to recreate the same docker over and over an over again. I manage all my containers from one unified Portainer instance, would be nice to have this for Watchtower as well.

@terrelsa13
Copy link

+1

Ditto. Running Proxmox server with a dozen or so LXCs hosting Portainer + one other containerized app. I recently found the time to try Watchtower. I set up a single LXC with Portainer and Watchtower. I thought I was going to be able to update the remote containers using this single instance. I am now learning I will need to go thru each LXC host running docker and standup an instance of Watchtower.

I too think it would be great if Watchtower could update multiple remotes as well as its local.

@Alindil
Copy link

Alindil commented Jan 17, 2025

+1

i use docker on proxmox and it's hell to put watchtower on every lcx

@NinthMajor
Copy link

+1

I run a couple of containers on my NAS and the rest across a couple of mini pcs. I'm just learning about watchtower, and this is one of my first questions as I'm learning how to set it up.

@ABelevcov
Copy link

+1

will waiting also....

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

No branches or pull requests