Configuration: Dynamic from control plane

These instructions are slightly more complex as you must also set up a control plane to provide Envoy with its configuration.

There are a number of control planes compatible with Envoy’s API such as Gloo or Istio.

You may also wish to explore implementing your own control plane, in which case the Go Control Plane provides a reference implementation that is a good place to start.

At a minimum, you will need to start Envoy configured with the following sections:

  • node to uniquely identify the proxy node.

  • dynamic_resources to tell Envoy which configurations should be updated dynamically

  • static_resources to specify where Envoy should retrieve its configuration from.

You can also add an admin section if you wish to monitor Envoy or retrieve stats or configuration information.

The following sections walk through the dynamic configuration provided in the demo dynamic control plane configuration file.

node

The node should specify cluster and id.

  1. 1node:
  2. 2 cluster: test-cluster
  3. 3 id: test-id
  4. 4
  5. 5dynamic_resources:

dynamic_resources

The dynamic_resources specify the configuration to load dynamically, and the cluster to connect for dynamic configuration updates.

In this example, the configuration is provided by the xds_cluster configured below.

  1. 3 id: test-id
  2. 4
  3. 5dynamic_resources:
  4. 6 ads_config:
  5. 7 api_type: GRPC
  6. 8 transport_api_version: V3
  7. 9 grpc_services:
  8. 10 - envoy_grpc:
  9. 11 cluster_name: xds_cluster
  10. 12 cds_config:
  11. 13 resource_api_version: V3
  12. 14 ads: {}
  13. 15 lds_config:
  14. 16 resource_api_version: V3
  15. 17 ads: {}
  16. 18
  17. 19static_resources:

static_resources

Here we specify the static_resources to retrieve dynamic configuration from.

The xds_cluster is configured to query a control plane at http://my-control-plane:18000 .

  1. 17 ads: {}
  2. 18
  3. 19static_resources:
  4. 20 clusters:
  5. 21 - type: STRICT_DNS
  6. 22 typed_extension_protocol_options:
  7. 23 envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
  8. 24 "@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
  9. 25 explicit_http_config:
  10. 26 http2_protocol_options: {}
  11. 27 name: xds_cluster
  12. 28 load_assignment:
  13. 29 cluster_name: xds_cluster
  14. 30 endpoints:
  15. 31 - lb_endpoints:
  16. 32 - endpoint:
  17. 33 address:
  18. 34 socket_address:
  19. 35 address: my-control-plane
  20. 36 port_value: 18000
  21. 37
  22. 38admin: