March 2020
Intermediate to advanced
626 pages
14h 45m
English
If it has been determined that 100% of the traffic should now be shifted to v2 of api after testing it successfully, the weight can be defined as 100% to subset v2. This can be done with the following code:
# Script: 16-service-splitter-100-shift.hcl...splits = [ { weight = 0, service_subset = "v1" }, { weight = 100 service_subset = "v2" }]
$ consul config write 16-service-splitter-100-shift.hcl$ consul config list -kind service-splitterapi
$ curl -s http://localhost:30145?[1-10] | grep "Pod Name.*api"Pod Name : api-v2-5d64d5f8ff-zlcp6Pod Name : api-v2-5d64d5f8ff-zlcp6 ...
Read now
Unlock full access