Plural GitOps Distribution Architecture
Before getting into detail about how Plural’s Gitops architecture works, a high level overview of Plural’s architecture is likely useful context. To simplify, Plural provides a hub-spoke architecture where there’s a central management plane (hub) that exposes a control api to agents on individual managed clusters (spokes). These clusters poll at a frequent interval for changes or send back information to the management hub, which then stores and indexes the information for presentation to our UI or integration with our APIs. Visually, it looks something like this:

As far as our integration with Git and SCM providers, almost the entire concern is with the management hub cluster, although it is important to understand the cluster-level agent plays a role as well will be, which be explained a bit too.
GitOps architecture
Plural implements the distribution process for all Git (and helm and OCI) manifests with what you could consider a Git-aware CDN architecture. This is described below:
The management cluster is given a request from an agent to deliver a tarball. This is uniquely identified by a computed digest from the configuration in our api, and the management cluster searches for it in a multilevel cache. The cache works as follows:
- A node-level cache by digest, which if its found, is immediately read from disk and returned.
- A sharded cache, w/ one instance per git repository, which is used if the node level cache misses. Fetches to this cache are also proxied through its node’s node-level cache, ensuring that it is warmed, or also potentially getting another cache hit as a prior request might have already warmed that cache.
- An agent, managed by the erlang runtime, which maintains the current state of the sharded cache by refetching from Git roughly once every 2 minutes. This allows us to find the state of upstream changes relatively quickly but not pressure the SCM provider hosting the git repository as well.
The overall architecture visually looks something like the following:
