node.value
.
checked
, and use a combination of the data path and parent data path (below).
node.value
. You would then change the data path setting to be hostname
, since this is where the hostname data resides in the JSON string. Tyk automatically assumes that the data_path in this case is in a string-encoded JSON object and will try to deserialise it.port
value for the service in the nested JSON. In this case you can set the port data path value and Tyk will treat data path as the hostname and zip them together (this assumes that the hostname element does not end in a slash or resource identifier such as /widgets/
).port
.
proxy
section of your API Definition:
service_discovery.use_discovery_service
: Set this to true
to enable the discovery module.service_discovery.query_endpoint
: The endpoint to call, this would probably be your Consul, etcd or Eureka K/V store.service_discovery.data_path
: The namespace of the data path so, for example, if your service responds with:node.value
.
service_discovery.use_nested_query
: Sometimes the data you are retrieving is nested in another JSON object, e.g. this is how etcd responds with a JSON object as a value key:use_nested_query
to true
, and use a combination of the data_path
and parent_data_path
(below)
service_discovery.parent_data_path
: This is the namespace of the where to find the nested value, in the above example, it would be node.value
. You would then change the data_path
setting to be hostname
, since this is where the host name data resides in the JSON string. Tyk automatically assumes that the data_path
in this case is in a string-encoded JSON object and will try to deserialise it.data_path
namespace to that object in order to find the value.
service_discovery.port_data_path
: In the above nested example, we can see that there is a separate port
value for the service in the nested JSON. In this case you can set the port_data_path
value and Tyk will treat data_path
as the hostname and zip them together (this assumes that the hostname element does not end in a slash or resource identifier such as /widgets/
).port_data_path
would be port
.
service_discovery.use_target_list
: If you are using load balancing, set this value to true
and Tyk will treat the data path as a list and inject it into the target list of your API Definition.
service_discovery.cache_timeout
: Tyk caches target data from a discovery service, in order to make this dynamic you can set a cache value when the data expires and new data is loaded. Setting it too low will cause Tyk to call the SD service too often, setting it too high could mean that failures are not recovered from quickly enough.
service_discovery.target_path
: Use this setting to set a target path to append to the discovered endpoint, since many SD services only provide host and port data, it is important to be able to target a specific resource on that host, setting this value will enable that.
+json
:
linkerd.yaml
file, located in the config/
directory:
host:port
address.
Custom-Header
in the Add this header: field and the value of the Linkerd app-id
in the Header value field.