Skip to content

Instantly share code, notes, and snippets.

@mccv
Created April 28, 2018 03:52
Show Gist options
  • Save mccv/c3f07ed3292c5aa3528cc1c0cb8888c7 to your computer and use it in GitHub Desktop.
Save mccv/c3f07ed3292c5aa3528cc1c0cb8888c7 to your computer and use it in GitHub Desktop.
A go template file for configuring the EnvoyProxy to talk to an XDS server for LDS/CDS
{
"node": {
"id": "{{envOrDefault "ENVOY_NODE_ID" "some-node"}}",
"cluster": "{{envOrDefault "ENVOY_NODE_CLUSTER" "some-cluster"}}",
"locality": {
"zone": "{{envOrDefault "ENVOY_NODE_ZONE" "some-zone"}}"
}
},
"static_resources": {
"clusters": [
{
"name": "tbn-xds",
"type": "static",
"connect_timeout": {
"seconds": "{{envOrDefault "ENVOY_XDS_CONNECT_TIMEOUT_SECS" "30"}}"
},
"lb_policy": "ROUND_ROBIN",
"hosts": [
{
"socket_address": {
"protocol": "TCP",
"address": "{{envOrDefault "ENVOY_XDS_IP" "127.0.0.1"}}",
"port_value": "{{envOrDefault "ENVOY_XDS_PORT" "50000"}}"
}
}
],
"http2_protocol_options": {
"max_concurrent_streams": 10
}
}
]
},
"dynamic_resources": {
"lds_config": {
"api_config_source": {
"api_type": "GRPC",
"cluster_names": ["tbn-xds"],
"refresh_delay": {
"seconds": {{envOrDefault "ENVOY_XDS_REFRESH_DELAY_SECS" "10"}}
}
}
},
"cds_config": {
"api_config_source": {
"api_type": "GRPC",
"cluster_names": ["tbn-xds"],
"refresh_delay": {
"seconds": {{envOrDefault "ENVOY_XDS_REFRESH_DELAY_SECS" "10"}}
}
}
}
},
"admin":{
"access_log_path": "{{envOrDefault "ENVOY_ADMIN_LOG" "/tmp/envoy-admin.log"}}",
"address": {
"socket_address": {
"protocol": "TCP",
"address": "{{envOrDefault "ENVOY_ADMIN_IP" "0.0.0.0"}}",
"port_value": "{{envOrDefault "ENVOY_ADMIN_PORT" "9999"}}"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment