Set Mesh-wide Configuration
Last updated
Was this helpful?
Last updated
Was this helpful?
These examples show how you can apply mesh-wide policy changes using the cli and .
command-line JSON processor
setup with a running Fabric mesh.
To apply a mesh-wide configuration change, we need to loop through each Grey Matter Object you wish to change and reapply a new configuration. This can be done by using the greymatter list $object
and greymatter edit $object_key
in tandem.
This example will set circuit breaker max_connections
to 500
for all clusters in the service mesh. Create a file named update.json
This update will be merged in with the current values of each cluster object when run in the following snippet. It's best to run these commands a few times individually first, to make sure the update.json
creates the expected change. In the below example, my cluster is cluster-slo-service
.
If you're satisfied, apply the change to the entire mesh:
Similar to the above example, create a file update.json
with the proposed update to all proxy
objects:
Note that we must also supply any other currently active proxy filters (in this case just "gm.metrics"
, since the entirety of "active_proxy_filters"
will be overridden. Also note that we have an attribute __REPLACE_WITH_TOPIC_NAME__
. The kafka topic is specific to each proxy, so we must replace this with the proxy name for each proxy we change.
Apply these changes with a similar script as above.
In the above example, we update only the proxies that have proxy_filters.gm_observables.eventTopic
equal to "fabric"
.
Health checks can be added the same way we updated the clusters above, as all we need to update is the configuration options for health_checks
on each cluster
. Change update.json
to enable a basic health check.
Change update.json
for basic outlier detection.
Apply this update to each cluster
by running the snippet
You should now see that health checks are running. Follow the logs from any given sidecar to see that health checks have been correctly enabled.
Often there are objects "floating around" in the mesh from previous deployments or experiments. These objects can be partially detected by looping through each one and ensuring that each one was created with a name, zone_key, or other basic properties.
The above snippet will trigger if a zone_key
, cluster_key
, or instances
attributes in any cluster is not assigned.
It's often useful to be able to update objects in the mesh only with specific attributes. We can do this by modifying our shell
snippet above to use . Note: all the shell snippets in this doc can be changed to only update on specific attributes by adding the below if
block.
Health checks and outlier detection help determine if an endpoint is healthy and our services are configured correctly. A common problem this can fix is incorrectly configured or unresponsive hosts. See for available configurations and for api definition.