brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: choose Polling in a Portainer GitOps update when your Git host can't reach Portainer

Portainer
~/tips/tip-portainer-git-polling-fetch-interval

cat ~/tips/tip-portainer-git-polling-fetch-interval.md

Lets Portainer check your Git repository on a timer, so no inbound webhook is needed.

Webhooks are neat, but they need your Git host to reach Portainer. At home, behind a router, that’s not always something I want to open up. Portainer has a second way that works the other direction.

When you deploy a stack from a Git repository, there’s a GitOps updates toggle. Switch it on and you choose a mechanism: Polling or Webhook.

  • Webhook gives you a URL that your Git host calls to trigger an update on demand.
  • Polling makes Portainer check the repository on its own, at the Fetch interval you set.

Polling is the one that works with no inbound connection at all, because Portainer is the one reaching out. For a Portainer server that is only reachable on your own network, that is the simple option.

Two settings change what happens when a check finds something. Re-pull image always pulls the newest version of the container images on an update, like --pull=always for docker run. Force redeployment redeploys at every interval, even without a change in Git, and it overwrites local changes. When it is off, an update only happens when Portainer sees a change in the remote repository.

The caveat is the delay. A webhook reacts at once, while polling reacts at the next check, so a short interval gives you speed and a long one gives your Git host less traffic. The Portainer docs don’t give a default, so look at what the field shows on your version.

Further reading: Portainer: add a stack from Git

More Portainer tips Put Portainer environments in groups and give users access to a whole group Portainer's Edge Agent checks in every 5 seconds, and you can change that docker run -d -p 9001:9001 --name portainer_agent --restart=always \ Deploy the container → Replace Public IP: 192.168.1.20 All Portainer tips (28) All topics

Link