March 2020
Intermediate to advanced
626 pages
14h 45m
English
Traffic can be split in a round-robin fashion by specifying a 50-50 weight for both services, as follows:
# Script: 15-service-splitter-round-robin.hcl...splits = [ { weight = 50, service_subset = "v1" }, { weight = 50 service_subset = "v2" }]
$ consul config write 15-service-splitter-round-robin.hcl$ consul config list -kind service-splitterapi
$ curl -s http://localhost:30145?[1-10] | grep "Pod Name.*api"Pod Name : api-v1-7fcf5d98d4-tgqrkPod Name : api-v1-7fcf5d98d4-tgqrkPod ...
Read now
Unlock full access