Examples

    A minimal fully static bootstrap config is provided below:

    A bootstrap config that continues from the above example with dynamic endpoint discovery via an gRPC management server listening on 127.0.0.1:5678 is provided below:

    1. access_log_path: /tmp/admin_access.log
    2. address:
    3. socket_address: { address: 127.0.0.1, port_value: 9901 }
    4. static_resources:
    5. listeners:
    6. - name: listener_0
    7. address:
    8. socket_address: { address: 127.0.0.1, port_value: 10000 }
    9. filter_chains:
    10. - filters:
    11. - name: envoy.filters.network.http_connection_manager
    12. typed_config:
    13. "@type": type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager
    14. stat_prefix: ingress_http
    15. codec_type: AUTO
    16. route_config:
    17. name: local_route
    18. virtual_hosts:
    19. - name: local_service
    20. domains: ["*"]
    21. routes:
    22. - match: { prefix: "/" }
    23. route: { cluster: some_service }
    24. http_filters:
    25. - name: envoy.filters.http.router
    26. clusters:
    27. - name: some_service
    28. connect_timeout: 0.25s
    29. lb_policy: ROUND_ROBIN
    30. type: EDS
    31. eds_cluster_config:
    32. eds_config:
    33. api_config_source:
    34. api_type: GRPC
    35. envoy_grpc:
    36. cluster_name: xds_cluster
    37. connect_timeout: 0.25s
    38. type: STATIC
    39. lb_policy: ROUND_ROBIN
    40. http2_protocol_options: {}
    41. upstream_connection_options:
    42. # configure a TCP keep-alive to detect and reconnect to the admin
    43. # server in the event of a TCP socket half open connection
    44. tcp_keepalive: {}
    45. load_assignment:
    46. cluster_name: xds_cluster
    47. endpoints:
    48. - lb_endpoints:
    49. - endpoint:
    50. address:
    51. socket_address:
    52. address: 127.0.0.1
    53. port_value: 5678

    Notice above that xds_cluster is defined to point Envoy at the management server. Even in an otherwise completely dynamic configurations, some static resources need to be defined to point Envoy at its xDS management server(s).

    In the above example, the EDS management server could then return a proto encoding of a DiscoveryResponse:

    The versioning and type URL scheme that appear above are explained in more detail in the documentation.

    A fully dynamic bootstrap configuration, in which all resources other than those belonging to the management server are discovered via xDS is provided below:

    1. admin:
    2. access_log_path: /tmp/admin_access.log
    3. address:
    4. socket_address: { address: 127.0.0.1, port_value: 9901 }
    5. dynamic_resources:
    6. lds_config:
    7. api_config_source:
    8. api_type: GRPC
    9. grpc_services:
    10. envoy_grpc:
    11. cluster_name: xds_cluster
    12. cds_config:
    13. api_config_source:
    14. api_type: GRPC
    15. grpc_services:
    16. envoy_grpc:
    17. cluster_name: xds_cluster
    18. clusters:
    19. connect_timeout: 0.25s
    20. type: STATIC
    21. lb_policy: ROUND_ROBIN
    22. http2_protocol_options: {}
    23. upstream_connection_options:
    24. # configure a TCP keep-alive to detect and reconnect to the admin
    25. # server in the event of a TCP socket half open connection
    26. tcp_keepalive: {}
    27. load_assignment:
    28. cluster_name: xds_cluster
    29. endpoints:
    30. - lb_endpoints:
    31. - endpoint:
    32. address:
    33. socket_address:
    34. address: 127.0.0.1
    35. port_value: 5678

    The management server could respond to RDS requests with:

    1. version_info: "0"
    2. resources:
    3. - "@type": type.googleapis.com/envoy.api.v2.RouteConfiguration
    4. name: local_route
    5. virtual_hosts:
    6. - name: local_service
    7. domains: ["*"]
    8. routes:
    9. - match: { prefix: "/" }
    10. route: { cluster: some_service }

    The management server could respond to CDS requests with:

    The management server could respond to EDS requests with:

    1. version_info: "0"
    2. resources:
    3. - "@type": type.googleapis.com/envoy.api.v2.ClusterLoadAssignment
    4. cluster_name: some_service
    5. endpoints:
    6. - lb_endpoints:
    7. - endpoint:
    8. address:
    9. socket_address:
    10. address: 127.0.0.2