Policy

Before StartYou should have NO virtualservice nor destinationrule (in tutorial namespace) kubectl get virtualservice kubectl get destinationruleif so run:
  1. ./scripts/clean.sh tutorial

Rate Limiting (Not working yet in 1.1)

The Rate Limiting rules take some time to be applied and reflected. Be patient here!

Here we will limit the number of concurrent requests into recommendation v2

Now apply the rate limit handler

  1. kubectl create -f istiofiles/recommendation_rate_limit_handler.yml

Now setup the requestcount quota

  1. kubectl create -f istiofiles/rate_limit_rule.yml

Throw some requests at customer:

  1. ./scripts/run.sh http://istio-ingressgateway-istio-system.$(minishift ip).nip.io/customer

You should see some 429 errors:

  1. customer => preference => recommendation v2 from '2819441432-f4ls5': 108
  2. customer => preference => recommendation v1 from '99634814-d2z2t': 1932
  3. customer => preference => recommendation v2 from '2819441432-f4ls5': 109
  4. customer => preference => recommendation v1 from '99634814-d2z2t': 1933
  5. customer => 503 preference => 429 RESOURCE_EXHAUSTED:Quota is exhausted for: RequestCount
  6. customer => preference => recommendation v1 from '99634814-d2z2t': 1934
  7. customer => preference => recommendation v2 from '2819441432-f4ls5': 110
  8. customer => preference => recommendation v1 from '99634814-d2z2t': 1935
  9. customer => 503 preference => 429 RESOURCE_EXHAUSTED:Quota is exhausted for: RequestCount
  10. customer => preference => recommendation v1 from '99634814-d2z2t': 1936
  11. customer => preference => recommendation v2 from '2819441432-f4ls5': 111
  12. customer => preference => recommendation v1 from '99634814-d2z2t': 1937
  13. customer => 503 preference => 429 RESOURCE_EXHAUSTED:Quota is exhausted for: RequestCount
  14. customer => preference => recommendation v1 from '99634814-d2z2t': 1938
  15. customer => preference => recommendation v2 from '2819441432-f4ls5': 112

Clean up

  1. kubectl delete -f istiofiles/rate_limit_rule.yml
  2. kubectl delete -f istiofiles/recommendation_rate_limit_handler.yml

or you can run:

  1. ./scripts/clean.sh tutorial