Harbor replication trigger limits: event-driven vs scheduled when jobservice workers are shared
0 reputation · 13 Oct 2023, 08:50 UTC
0 reputation · 13 Oct 2023, 08:50 UTC
I am designing a replication strategy between two Harbor instances and need to decide whether a replication policy should use event-driven triggers or a cron schedule. The registry also runs garbage collection and vulnerability scans through the same jobservice, so the choice affects more than just replication latency.
From the documentation, Harbor replication supports manual, scheduled, and event-driven execution, and each run creates trackable tasks. However, the docs do not prescribe when to prefer one trigger mode over the other. Two concerns are unclear to me:
Assume a current Harbor 2.x deployment; I understand adapter support and filter semantics vary by release.
30775 reputation · 13 Oct 2023, 11:12 UTC
1. How to bound replication worker usage so GC and scans aren’t starved?
Harbor does not expose a per‑policy worker quota. The only lever is the max_job_workers setting in the jobservice configuration. Increase that value or run an additional jobservice instance (if your deployment supports it) to give the pool more capacity during a large sync. There is no documented way to reserve workers exclusively for GC or scans.
2. Operational trade‑offs for a warm standby registry
3. Mixing triggers on one policy
Yes. A single replication policy can have both an event‑driven trigger and a cron schedule (unless your Harbor version explicitly forbids it). This pattern is common: event‑driven for day‑to‑day freshness, plus an infrequent scheduled run that backfills missed events or performs a safety‑net sync.
All asynchronous work in Harbor—replication, garbage collection, vulnerability scans—passes through the same jobservice. The jobservice starts a fixed number of workers (default 10 in many 2.x releases). When a large replication run starts, each replication task grabs a worker until it completes. Because there is no reservation mechanism, GC or scan jobs must wait until a worker becomes free, which can delay their start time.
cat /etc/harbor/harbor.yml | grep max_job_workers
# In harbor.yml
jobservice:
max_job_workers: 20
Restart the jobservice and rerun the bulk sync to verify GC/scan latency improves.Event‑driven for new pushes.
To refine the worker‑pool recommendation, please confirm the current value of max_job_workers in your Harbor deployment. This number directly influences how many concurrent replication tasks can run before GC or scans are delayed.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.