Sources

Sources are used to retrieve arbitrary data that can then be represented in templates as envoy configuration.

A new custom source can be added by subclassing the Source class and adding an entry point using setuptools.

todo add guide for adding entry points

When the control plane receives a request for configuration from an envoy proxy, it first runs through all the configured sources and combines the data received from them into a single list, to be used within templates.

The results are cached for 30 seconds to allow several proxies to poll at the same time, receiving data that is consistent with each other. todo, make the cache expiry configurable

sovereign.sources.load_sources(service_cluster, modify=True, debug=False) → List[dict]

Runs all configured Sources, returning a list of the combined results

Parameters:
  • service_cluster – filter results by envoy service cluster todo make filtering configurable
  • modify – switch to enable or disable modifications via Modifiers
  • debug – switch mainly used for testing
Returns:

a list of dictionaries