Skip to content

Load Test Multiple HTTP endpoints

Your first experiment describes how to load test a single endpoint from an HTTP service inside Kubernetes. This tutorial expands on the previous tutorial and describes how to load test multiple endpoints from an HTTP service.

load-test-http

Before you begin
  1. Ensure that you have a Kubernetes cluster and the kubectl CLI. You can create a local Kubernetes cluster using tools like Kind or Minikube.
  2. Deploy the sample HTTP service in the Kubernetes cluster.
    kubectl create deploy httpbin --image=kennethreitz/httpbin --port=80
    kubectl expose deploy httpbin --port=80
    

Launch experiment

Launch the Iter8 experiment inside the Kubernetes cluster.

iter8 k launch \
--set "tasks={ready,http,assess}" \
--set ready.deploy=httpbin \
--set ready.service=httpbin \
--set ready.timeout=60s \
--set http.endpoints.get.url=http://httpbin.default/get \
--set http.endpoints.getAnything.url=http://httpbin.default/anything \
--set http.endpoints.post.url=http://httpbin.default/post \
--set http.endpoints.post.payloadStr=hello \
--set assess.SLOs.upper.http-get/error-count=0 \
--set assess.SLOs.upper.http-get/latency-mean=50 \
--set assess.SLOs.upper.http-getAnything/error-count=0 \
--set assess.SLOs.upper.http-getAnything/latency-mean=100 \
--set assess.SLOs.upper.http-post/error-count=0 \
--set assess.SLOs.upper.http-post/latency-mean=150 \
--set runner=job
About this experiment

This experiment consists of three tasks, namely, ready, http, and assess.

The ready task checks if the httpbin deployment exists and is available, and the httpbin service exists.

The http task sends requests to three endpoints from the cluster-local HTTP service, and collects Iter8's built-in HTTP load test metrics. The three endpoints are http://httpbin.default/get, http://httpbin.default/anything, and http://httpbin.default/post. The last endpoint also has a payload string hello.

The assess task verifies if each endpoint satisfies their respective error count and mean latency SLOs. All three must have an error count of 0 but the get, getAnything, and post endpoints are allowed a maximum mean latency of 50, 100, and 150 msecs, respectively.

This is a single-loop Kubernetes experiment where all the previously mentioned tasks will run once and the experiment will finish. Hence, its runner value is set to job.


Assert experiment outcomes, view experiment report, view experiment logs, and cleanup as described in your first experiment.


Cleanup

Remove the Iter8 experiment and the sample app from the Kubernetes cluster and the local Iter8 charts folder.

iter8 k delete
kubectl delete svc/httpbin
kubectl delete deploy/httpbin