{"id":20840689,"url":"https://github.com/kong/kong-gateway-performance-benchmark","last_synced_at":"2025-05-08T22:06:41.863Z","repository":{"id":222745419,"uuid":"728806962","full_name":"Kong/kong-gateway-performance-benchmark","owner":"Kong","description":"Framework for performance testing of kong gateway with K6","archived":false,"fork":false,"pushed_at":"2024-05-23T19:13:08.000Z","size":1903,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-08T22:06:35.770Z","etag":null,"topics":["api-gate","aws","k6","kong","kubernetes","kubernetes-cluster","kubernetes-deployment","performance-testing","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-12-07T18:30:55.000Z","updated_at":"2025-04-09T10:27:53.000Z","dependencies_parsed_at":"2024-02-16T01:26:19.911Z","dependency_job_id":"8919fc24-1426-42be-9a84-6be4407e2840","html_url":"https://github.com/Kong/kong-gateway-performance-benchmark","commit_stats":null,"previous_names":["kong/kong-gateway-performance-benchmark"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kong%2Fkong-gateway-performance-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kong%2Fkong-gateway-performance-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kong%2Fkong-gateway-performance-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kong%2Fkong-gateway-performance-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kong","download_url":"https://codeload.github.com/Kong/kong-gateway-performance-benchmark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253154974,"owners_count":21862622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-gate","aws","k6","kong","kubernetes","kubernetes-cluster","kubernetes-deployment","performance-testing","terraform"],"created_at":"2024-11-18T01:17:21.086Z","updated_at":"2025-05-08T22:06:41.845Z","avatar_url":"https://github.com/Kong.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"Kong Gateway Performance Benchmark\n==================================\n\nScripts to deploy:\n- k8s cluster on EKS\n- Kong Gateway with Ingress Controller (CE or EE)\n- A test upstream ([go-bench-suite](https://github.com/asoorm/go-bench-suite))\n- [k6 operator](https://github.com/grafana/k6-operator)\n\n\nRun `provision-eks-cluster` terraform scripts first to create the EKS cluster\n\nFirst, you need to make sure you have proper authentication to interact with [AWS](https://docs.aws.amazon.com/cli/latest/userguide/sso-configure-profile-token.html)\n```\naws sso login\n```\nThen run the `terraform` command to create the cluster, it could take around 15-20 minutes to create the EKS cluster, so be patient. \n```\nterraform init -input=false  \nterraform plan -out YOUR_PLAN_NAME.plan -input=false\nterraform apply -auto-approve YOUR_PLAN_NAME.plan\n```\n\nThen run:\n```\naws eks --region $(terraform output -raw region) update-kubeconfig \\\n    --name $(terraform output -raw cluster_name)\n```\n\nVerify cluster is running:\n```\n$ kubectl get nodes\nNAME                                       STATUS   ROLES    AGE   VERSION\nip-10-0-2-83.us-west-2.compute.internal    Ready    \u003cnone\u003e   25m   v1.27.7-eks-e71965b\nip-10-0-3-172.us-west-2.compute.internal   Ready    \u003cnone\u003e   25m   v1.27.7-eks-e71965b\nip-10-0-3-91.us-west-2.compute.internal    Ready    \u003cnone\u003e   25m   v1.27.7-eks-e71965b\n```\n\nNext, you can start the deployment of kong and all the other services. Please note, if you want to test [Kong Enterprise](https://konghq.com/products/kong-enterprise), there are some extra setup required before you run the terraform scripts in `deploy-k8s-resources`\n\nExtra configurations for [Kong Enterprise](https://konghq.com/products/kong-enterprise)\n1. Update [license.json](https://github.com/Kong/kong-gateway-performance-benchmark/blob/main/deploy-k8s-resources/kong_helm/license.json) with a valid `license.json` to start Kong Enterprise. If you don't have one, please reach out to [team](mailto:bizdev@konghq.com?subject=[GitHub]%20Source%20Han%20Sans) for a temporary testing license.\n2. Add terraform variables\n```\nexport TF_VAR_kong_enterprise=true\nexport TF_VAR_kong_repository=kong/kong-gateway\nexport TF_VAR_kong_version=3.6\n```\n3. If you are testing non-release kong enterprise image, you also need to set `kong_effective_semver` along with other variables like \n```\nexport TF_VAR_kong_enterprise=true\nexport TF_VAR_kong_repository=kong/kong-gateway-dev\nexport TF_VAR_kong_version=3.6-test-image\nexport TF_VAR_kong_effective_semver=3.6\n```\n\nRun `deploy-k8s-resources` terraform scripts to start the deployment\n```\nterraform init -input=false  \nterraform plan -out YOUR_PLAN_NAME.plan -input=false\nterraform apply -auto-approve YOUR_PLAN_NAME.plan\n```\n\nAfter all the pods are up and running, try to reach kong with endpoint like \n```\ncurl -i --insecure -X GET https://YOUR-AWS-ELB-ENDPOINT.REGION.elb.amazonaws.com/upstream/json/valid\n```\n\nThe default setup is 1 service/route and no plugin enabled, to enable other kong configurations, you need to navigate to `deploy-k8s-resources/kong_helm` and apply the `.yaml` you need. \n\nThere are also scripts in the `deploy-k8s-resources/kong_helm` folder that could help you generate more kong config data([service/route](https://github.com/Kong/kong-gateway-performance-benchmark/blob/main/deploy-k8s-resources/kong_helm/upstream-generator.sh), [consumers](https://github.com/Kong/kong-gateway-performance-benchmark/blob/main/deploy-k8s-resources/kong_helm/consumer-generator.sh), [basic-auth](https://github.com/Kong/kong-gateway-performance-benchmark/blob/main/deploy-k8s-resources/kong_helm/basic-auth-testuser-secret-generator.sh), [key-auth](https://github.com/Kong/kong-gateway-performance-benchmark/blob/main/deploy-k8s-resources/kong_helm/key-auth-testuser-secret-generator.sh)) you need. \n\nHere are some examples about how you can apply some of the kong configurations\n\nDeploy other k8s resources:\n```\nkubectl apply -f prometheus-plugin.yaml -n kong\nkubectl apply -f basic-auth-testuser-secret.yaml -n kong\nkubectl apply -f key-auth-testuser-secret.yaml -n kong\nkubectl apply -f consumer-testuser.yaml -n kong\n\n# To enable basic-auth\nkubectl apply -f basic-auth-plugin.yaml -n kong\n\n# To enable key-auth\nkubectl apply -f key-auth-plugin.yaml -n kong\n\n```\n\nIf you want to run the tests, you can navigate to `deploy-k8s-resources/k6_tests` folder, and trigger the test with running the `run_k6_tests.sh` script. you can run `bash run_k6_tests.sh --help` to see what input is expected while running the script. An example of running the test would be: \n```\nbash run_k6_tests.sh k6_tests_01.js 1 300 900s false false \n```\n\nAfter triggering the k6 tests, you can check to see whether the k6 test is running by command like below:\n```\nkubectl get pods -n k6\nNAME                                                 READY   STATUS      RESTARTS   AGE\nk6-k6-operator-controller-manager-6b7f5b5647-bz9ml   2/2     Running     0          5d19h\nk6-kong-1-f49x6                                      0/1     Running     0          118s\nk6-kong-initializer-f5w5j                            0/1     Completed   0          2m1s\n```\n\nPlease note, in our default setup for [k6](https://github.com/Kong/kong-gateway-performance-benchmark/blob/main/provision-eks-cluster/variables.tf) tooling, we are using [c5.metal](https://aws.amazon.com/ec2/instance-types/c5/), it might be too powerful/expensive for some users. We use it as default because `k6` is very resources demanding when running [high load performance tests](https://k6.io/docs/testing-guides/running-large-tests/#hardware-considerations). If you decided to use a less powerful machine for `k6`, you need to adjust the default setup of the `resources` required for [k6-test.yaml](https://github.com/Kong/kong-gateway-performance-benchmark/blob/main/deploy-k8s-resources/k6_tests/k6-test.yaml)\n\n\nYou can monitor the pod CPU/MEM metrics with [metrics-server](https://github.com/kubernetes-sigs/metrics-server) with command like \n```\nkubectl top pod -n kong \nkubectl top pod -n k6\nkubectl top pod -n observability\n```\n\nYou can also view the metrics in realtime via grafana\n\nFirst find the grafana pod via command like \n```\nkubectl get pods -n observability \nNAME                                                 READY   STATUS    RESTARTS   AGE\ngrafana-6c9b96488c-2fvfm                             2/2     Running   0          26h\nprometheus-alertmanager-0                            1/1     Running   0          26h\nprometheus-kube-state-metrics-85596bfdb6-td55s       1/1     Running   0          26h\nprometheus-prometheus-node-exporter-h74g2            1/1     Running   0          26h\nprometheus-prometheus-node-exporter-qdbcf            1/1     Running   0          26h\nprometheus-prometheus-node-exporter-r6zqr            1/1     Running   0          26h\nprometheus-prometheus-pushgateway-79745d4495-5gb9h   1/1     Running   0          26h\nprometheus-server-7c4d9755b5-nwht2                   2/2     Running   0          26h\n```\n\nThen portforward the grafana pod to your local with command like \n```\nkubectl port-forward grafana-6c9b96488c-2fvfm 3000:3000 -n observability\n```\n\nNow you can load the grafana in your local browser with url like `http://localhost:3000/dashboards`\n\nIt will probably will ask you to login for the first time, the default username is `admin`, to find the password, use this command below and paste the output to the password field in your browser. \n```\nkubectl get secret --namespace observability grafana -o jsonpath=\"{.data.admin-password}\" | base64 --decode ; echo\n```\n\n![](grafana.gif)\n\n## License\n[Apache 2.0 License](https://github.com/Kong/kong-gateway-performance-benchmark/blob/main/LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkong%2Fkong-gateway-performance-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkong%2Fkong-gateway-performance-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkong%2Fkong-gateway-performance-benchmark/lists"}