K8s App/serverless/ML Frameworks¶
This tutorial provides examples of using the load-test-grpc
experiment chart with various Kubernetes app/serverless/ML frameworks. Refer to load-test-grpc
usage to learn more about this chart.
Dear Iter8 community
These examples are maintained by members of the Iter8 community, and may become outdated. If you find that something is not working, lend a helping hand and fix it in a PR. More examples are always welcome.
Knative¶
Before you begin
- Install Iter8.
- Install Knative and deploy your first Knative Service. As noted at the end of the Knative tutorial, when you curl the Knative service, you should see the expected output as follows.
curl http://hello.default.127.0.0.1.sslip.io
Hello World!
- Update the Knative service deployed above to a gRPC service as follows.
kn service update hello \ --image docker.io/grpc/java-example-hostname:latest \ --port 50051 \ --revision-name=grpc
- Download experiment chart.
iter8 hub -e load-test-grpc cd load-test-grpc
1. Run experiment¶
We will load test and validate SLOs for the Knative gRPC service using by running an Iter8 experiment.
The iter8 run
command combines an experiment chart with values, generates the experiment.yaml
file, runs the experiment, and writes results into the result.yaml
file. Run the experiment as follows.
iter8 run --set-string host="hello.default.127.0.0.1.sslip.io:50051" \
--set-string call="helloworld.Greeter.SayHello" \
--set-string protoURL="https://raw.githubusercontent.com/grpc/grpc-java/master/examples/example-hostname/src/main/proto/helloworld/helloworld.proto"
--set data.name="frodo" \
--set SLOs.error-rate=0 \
--set SLOs.latency/mean=400 \
--set SLOs.latency/p90=500 \
--set SLOs.latency/p'97\.5'=600
In the above experiment, the following SLOs are validated for the Knative service. - error rate is 0 - mean latency is under 400 msec - 90th percentile latency is under 500 msec - 97.5th percentile latency is under 600 msec
2. Assert outcomes¶
Assert that the experiment completed without any failures and SLOs are satisfied.
iter8 assert -c completed -c nofailure -c slos
3. View report¶
View a report of the experiment in HTML or text formats as follows.
iter8 report -o html > report.html
# open report.html with a browser. In MacOS, you can use the command:
# open report.html
iter8 report -o text