Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Weighted Routing in PAS
1. Check the "Enable Service Mesh" checkbox on the PAS 2.5 tile
2. Operators will have to configure the firewall, DNS and Load balancer settings to resolve the *.service-mesh.<app domain> to the IP of the
edge envoy.
3. Push a test app (app_v1) and map a route to it, this demo is using [Dora](
Preferably the test app can print out a version or an instance id. Dora has an endpoint that returns an instance id.
4. Push the test app as app_v2 with no route mapped to it initially
Steps for demo
1. curl the route mapped to the app_v1 with the `/id` or the version endpoint on your app to test which version of the app is being curled
2. Change the weight for v1 to 9 such that when you map a route to v2 with a weight of 1,. 90% of the traffic goes to v1. The CAPI v3 endpoints are [here](
cf curl /v3/route_mappings/$(echo "$(cf curl /v3/apps/$(cf app app-v1 --guid)/route_mappings | jq .resources[0].guid)" | tr -d '"') \
-d '{
"weight": 9
3. Map route to v2
cf map-route app-v2 --hostname dora
4. Increase weigth for v2 to send 75% of the traffic
cf curl /v3/route_mappings/$(echo "$(cf curl /v3/apps/$(cf app app-v2 --guid)/route_mappings | jq .resources[0].guid)" | tr -d '"') \
-d '{
"weight": 27
5. Unmap v1 send 100% of the traffic to v2
cf unmap-route dora-v1 --hostname dora
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.