Skip to content

Commit 755e90d

Browse files
author
Mazhar Islam
committed
Addressed comments from PR review
1 parent f1cfc05 commit 755e90d

File tree

5 files changed

+33
-12
lines changed

5 files changed

+33
-12
lines changed

walkthroughs/howto-k8s-appmesh-load-test/README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22
This walkthrough demonstrates how to load test AppMesh on EKS. It can be used as a tool for further load testing in different mesh configuration. We use [Fortio](https://github.com/fortio/fortio) to generate the load. Currently, this walkthrough only focuses AppMesh on EKS.
33

44
## Step 1: Prerequisites
5-
1. [Walkthrough: App Mesh with EKS](../eks/)
6-
1. Make sure you have "appmesh-prometheus" installed. You may follow this [live docs](https://aws.github.io/aws-app-mesh-controller-for-k8s/) _Guide_ section for further installation support.
7-
2. Alternatively, you can follow this doc: [Getting started with AWS App Mesh and Kubernetes](https://docs.aws.amazon.com/app-mesh/latest/userguide/getting-started-kubernetes.html) to install appmesh-controller and EKS cluster using `eksctl`.
8-
2. Clone this repository and navigate to the `walkthroughs/howto-k8s-appmesh-load-test` folder, all the commands henceforth are assumed to be run from the same directory as this README.
9-
3. Make sure you have the latest version of [AWS CLI v2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) installed.
5+
1. [Walkthrough: App Mesh with EKS](../eks/). Make sure you have:
6+
1. Cloned the [AWS AppMesh controller repo](https://github.com/aws/aws-app-mesh-controller-for-k8s). We will need this controller repo path (`CONTROLLER_PATH`) in [step 2](##step-2:-set-environment-variables).
7+
2. Created an EKS cluster and setup kubeconfig.
8+
3. Installed "appmesh-prometheus". You may follow this [App Mesh Prometheus](https://github.com/aws/eks-charts/tree/master/stable/appmesh-prometheus) chart for installation support.
9+
4. This load test uses [Ginkgo](https://github.com/onsi/ginkgo/tree/v1.16.4). Make sure you have ginkgo installed by running `ginkgo version`. If it's not, you may need to install it:
10+
1. Install [Go](https://go.dev/doc/install), if you haven't already.
11+
2. Install Ginkgo v1.16.4 (currently, AppMesh controller uses [ginkgo v1.16.4](https://github.com/aws/aws-app-mesh-controller-for-k8s/blob/master/go.mod#L13))
12+
1. `go get -u github.com/onsi/ginkgo/[email protected]` or
13+
2. `go install github.com/onsi/ginkgo/[email protected]` for GO version 1.17+
14+
5. (Optional) You can follow this doc: [Getting started with AWS App Mesh and Kubernetes](https://docs.aws.amazon.com/app-mesh/latest/userguide/getting-started-kubernetes.html) to install appmesh-controller and EKS cluster using `eksctl`.
15+
2. Clone this repository and navigate to the `walkthroughs/howto-k8s-appmesh-load-test` folder, all the commands henceforth are assumed to be run from the same directory as this `README`.
16+
3. Make sure you have the latest version of [AWS CLI v2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) or [AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv1.html) installed.
1017
4. This test requires Python 3 or later (tested with Python 3.9.6). So make sure you have [Python 3](https://www.python.org/downloads/) installed.
1118
5. Load test results will be stored into S3 bucket. So, in `scripts/constants.py` give your `S3_BUCKET` a unique name.
1219
6. In case you get `AccessDeniedException` (or any kind of accessing AWS resource denied exception) while creating any AppMesh resources (e.g., VirtualNode), don't forget to authenticate with your AWS account.
@@ -16,7 +23,7 @@ This walkthrough demonstrates how to load test AppMesh on EKS. It can be used as
1623
We need to set a few environment variables before starting the load tests.
1724

1825
```bash
19-
export CONTROLLER_PATH=<Path to the controller directory e.g., /home/userName/workplace/appmesh-controller/aws-app-mesh-controller-for-k8s>
26+
export CONTROLLER_PATH=<Path to the controller repo we cloned in step 1, e.g., /home/userName/workplace/appmesh-controller/aws-app-mesh-controller-for-k8s>
2027
export CLUSTER_NAME=<Name of the EKS cluster, e.g., appmeshtest>
2128
export KUBECONFIG=<If eksctl is used to create the cluster, the KUBECONFIG will look like: ~/.kube/eksctl/clusters/cluster-name>
2229
export AWS_REGION=us-west-2

walkthroughs/howto-k8s-appmesh-load-test/cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
nodeGroups:
1010
- name: ng-1
1111
instanceType: m5.4xlarge
12-
desiredCapacity: 10
12+
desiredCapacity: 4
1313
volumeSize: 80
1414
ssh:
1515
allow: true # will use ~/.ssh/id_rsa.pub as the default ssh key

walkthroughs/howto-k8s-appmesh-load-test/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"2": ["4"]
1010
},
1111
"load_tests": [
12-
{"test_name": "experiment16-qps50000-t10-c400", "url": "http://service-0.tls-e2e.svc.cluster.local:9080/", "qps": "50000", "t": "10s", "c":"400"}
12+
{"test_name": "experiment_x", "url": "http://service-0.tls-e2e.svc.cluster.local:9080/", "qps": "5000", "t": "10s", "c":"400"}
1313
],
1414
"metrics": {
1515
"envoy_ingress_rate_by_replica_set": "sum(rate(envoy_cluster_upstream_rq{job=\"appmesh-envoy\",kubernetes_pod_name=~\"node-.*\",envoy_cluster_name=~\"cds_ingress.*\"}[10s])) by (kubernetes_pod_name)",

walkthroughs/howto-k8s-appmesh-load-test/scripts/analyze_load_test_data.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33
import os
44
import subprocess
5+
from collections import OrderedDict
56
from pathlib import Path
67
from pprint import pprint
78

@@ -28,7 +29,6 @@ def get_s3_data():
2829

2930

3031
def plot_graph(actual_QPS_list, node_0_mem_list):
31-
node_0_mem_list = [float(x) for x in node_0_mem_list]
3232
Y = [x for _, x in sorted(zip(actual_QPS_list, node_0_mem_list))]
3333
X = sorted(actual_QPS_list)
3434
xpoints = np.array(X)
@@ -69,16 +69,19 @@ def read_load_test_data():
6969
node_0_mem = []
7070
for line in c:
7171
if "node-0" in line[0]:
72-
node_0_mem.append(line[2])
72+
node_0_mem.append(float(line[2]))
7373
max_mem = max(node_0_mem)
7474
node_0_mem_list.append(max_mem)
7575
attrb["max_mem"] = max_mem
7676
key = Path(f)
7777
experiment_results[os.path.join(key.parts[-3], key.parts[-2])] = attrb
7878

7979
# for research purpose
80-
print("Experiment results:")
81-
pprint(experiment_results)
80+
sorted_experiment_results = OrderedDict()
81+
for k, v in sorted(experiment_results.items(), key=lambda item: item[1]['max_mem']):
82+
sorted_experiment_results[k] = v
83+
print("Experiment results sorted:\n")
84+
pprint(sorted_experiment_results)
8285

8386
return actual_qps_list, node_0_mem_list
8487

walkthroughs/howto-k8s-appmesh-load-test/scripts/driver.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ if [ -z "${VPC_ID}" ]; then
3939
err "VPC_ID is not set"
4040
fi
4141

42+
# Check creds
43+
if [ -n "${USER}" ]; then
44+
check_version "isengardcli version"
45+
if [ $? -eq 0 ]
46+
then
47+
eval "$(isengardcli creds "$USER")"
48+
status=$?
49+
[ $status -eq 0 ] && echo "Ran isengard creds successfully!" || (err "isengard creds error.")
50+
fi
51+
fi
52+
4253
# Install python3 dependencies
4354
exec_command "python3 --version"
4455

0 commit comments

Comments
 (0)