Static Resources
Last updated
Was this helpful?
Last updated
Was this helpful?
GM-Control has the ability to read in raw envoy clusters and listeners from a static file on startup. This is different from file discovery, which continually reads and writes to the file dynamically during runtime has has a . Static configs can be combined with discovery (see --xds.static-resources.conflict-behavior
), but are themselves read only, and read in once at configuration time.
Static file configs are read in from the following configuration values:
Command Line Flag
Environment Variable
Meaning
Values
--xds.static-resources.filename
GM_CONTROL_XDS_STATIC_RESOURCES_FILENAME
The path of the filename to read in as a static config
/path/to/file.type
--xds.static-resources.format
GM_CONTROL_XDS_STATIC_RESOURCES_FORMAT
Type of file
json
or yaml
(default)
--xds.static-resources.conflict-behavior
GM_CONTROL_XDS_STATIC_RESOURCES_CONFLICT_BEHAVIOR
How to handle conflicts with cluster discovery
overwrite
(static config overwrites all other configuration on startup) or merge
(use static configuration when a config collision is detected, default)
The static resource configuration has the following API:
Name
Type
Meaning
clusters
list of upstream clusters.
clusterTemplate
listeners
list of listeners to apply to proxies.
loadAssignments
List of endpoints to match to a cluster
To enable loading of local clusters, set the environment variable GM_CONTROL_LOCAL_CLUSTERS
to a comma delimited string of cluster_name:port
. Here is an example:
This will create a pre-canned config for the gm-proxy
cluster and import it into gm-control with the host 127.0.0.1:8080
. The whole cluster config is listed below:
Array of
Array of
Array of
Instead of defining a large number of clusters statically, specifying a clusterTemplate
attribute provides a base structure which is filled in by each cluster definition in clusters
. A full example of this is available in the .
GM-Control provides a quick and easy utility to specify and for hosts running on the same host as control (i.e. running on localhost). It This can be useful for testing locally when running everything in a development environment on the same machine. This should not be used for a production environment.