Direct Config
Last updated
Was this helpful?
Last updated
Was this helpful?
The Grey Matter Proxy is first configured from a YAML configuration file on disk. This file takes any configuration available in the , as well as the additional Grey Matter filters that are made available through the SDK.
This file can be mounted into a container, or specified via flags with the gm-proxy
binary.
Destination
Short Form
Long Form
Default
Envoy
-c
--config-file
config.yaml
(current directory)
Due to the difficulties involved in mounting files directly on some container platforms, the Grey Matter Proxy also supports passing Envoy configuration files as a base64-encoded environment variable, which is then decoded and written to disk.
When using this mechanism, you must supply the full config, because it will entirely overwrite the default on disk.
Variable
Default
Description
ENVOY_CONFIG
""
Base64 encoded string of envoy configuration file
Using the template config discussed in the previous section is simple and less error prone. However, not everything is exposed via the template or API as there are a variety of functionalities continuously added to both Envoy and Grey Matter Proxy. So you may find yourself in a situation that certain configuration you want to specify is not yet available in the template or API. This is one of the situations you would need to use direct configuration. Due to the flat nature of environment variables, we found that highly nested configurations are easier to specify and read in JSON/YAML format. Of course, if you already use Envoy proxy in your current infrastructure, the hurdle of conversion is lower if you could use configuration files you already have. No matter what the reasons, Grey Matter provides a direct configuration mechanism.
Envoy fundamentally employs an eventual consistency model, however, there are cases, the order in which resources (e.g. endpoints, routes, clusters, etc) are generated or modified is crucial. To achieve this, there is something called Aggregated Discovery Service (ADS) which ensures them to be coalesced to a single stream to a single management servers. If you would like to do this on startup, providing this via a direct configuration will likely be more straight forward and efficient. Perhaps, the easiest way to think of this would be a way to provide the bootstrap configuration in its native format whether you will use this as a static configuration or dynamic configuration.
Here is the example configuration:
You can provide this as a file or base64 encoded environment variable to your sidecar. If you are using Kubernetes, you could create a ConfigMap with a content like above, and when you create your deployment or statefulset for your service, you can pass that information to GM Proxy like this:
As you see, the config.yaml
file gets mapped under /etc/greymatter/
and when you create a service, that location gets passed on to the proxy via the argument -c /etc/greymatter/config.yaml
as we discussed above.
Need help?
Create an account at to reach our team.