{"id":18521432,"url":"https://github.com/thingsboard/tb-k8s-perf-tests","last_synced_at":"2025-04-09T09:33:09.610Z","repository":{"id":72828352,"uuid":"224890416","full_name":"thingsboard/tb-k8s-perf-tests","owner":"thingsboard","description":"ThingsBoard PE performance test scripts","archived":false,"fork":false,"pushed_at":"2020-06-09T09:03:26.000Z","size":192,"stargazers_count":9,"open_issues_count":1,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-24T04:43:22.683Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/thingsboard.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,"publiccode":null,"codemeta":null}},"created_at":"2019-11-29T16:38:19.000Z","updated_at":"2025-02-12T13:23:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"cdeacbee-6eec-4aad-9053-fa9473f8cf6c","html_url":"https://github.com/thingsboard/tb-k8s-perf-tests","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsboard%2Ftb-k8s-perf-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsboard%2Ftb-k8s-perf-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsboard%2Ftb-k8s-perf-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsboard%2Ftb-k8s-perf-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thingsboard","download_url":"https://codeload.github.com/thingsboard/tb-k8s-perf-tests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248012820,"owners_count":21033247,"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":[],"created_at":"2024-11-06T17:25:51.352Z","updated_at":"2025-04-09T09:33:09.599Z","avatar_url":"https://github.com/thingsboard.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes resources configuration for ThingsBoard Microservices\n\nThis folder containing scripts and Kubernetes resources configurations to run ThingsBoard in Microservices mode.\n\n## Prerequisites\n\nThingsBoard Microservices are running on Kubernetes cluster.\nYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster.\n\nCurrent supported versions: \n\n- kubectl **1.17.0**\n- kops **1.15.0 (git-9992b4055)**\n\nFollow [Getting Started with kops on AWS](https://github.com/kubernetes/kops/blob/master/docs/getting_started/aws.md)\nto prepare necessary tools for deploying cluster on AWS using kops.\n\n\nInstall [Docker CE](https://docs.docker.com/install/) and do the login to the Docker Cloud.\n\nPlease make sure that you are able to run:\n\n`\ndocker run hello-world\n`\n\n## Generate ssh key for kops resources\n\nBy default ssh key that is located in the *~/.ssh/kops.pub* is going to be used to access kops resources.\nPleaes execute the following command to create this ssh key (please enter **/home/[YOUR_USER_NAME]/.ssh/kops** file name during key generation procedure):\n\n`\n$ ssh-keygen\n`\n\nSample:\n```\n$ voba@voba-desktop:~/projects/tb-pe-k8s-perf-tests$ ssh-keygen \n$ Generating public/private rsa key pair.\n$ Enter file in which to save the key (/home/voba/.ssh/id_rsa): /home/voba/.ssh/kops\n$ ...\n```\n\nYou can use your custom ssh key, but in that case please update **SSH_PUBLIC_KEY** property in the *.env* file and set it to your custom ssh key.\n\n\n## Deploy Cluster\n\nExecute the following command to deploy cluster:\n\n`\n$ ./cluster-deploy.sh\n`\n\nWait until cluster is ready. Execute the following command to check cluster status:\n\n`\n$ ./cluster-validate.sh\n`\n\n## Deploy Dashboard\n\n`\n$ ./k8s-deploy-metrics.sh\n`\n\n**NOTE** Kubernetes Dashboard will ask twice for the same admin credentials during initial login.\n\n\n## ThingsBoard Microservices Installation\n\nExecute the following command to run installation:\n\n`\n$ ./k8s-install-tb.sh --loadDemo\n`\n\nWhere:\n\n- `--loadDemo` - optional argument. Whether to load additional demo data.\n\n## Running\n\nExecute the following command to deploy resources:\n\n`\n$ ./k8s-deploy-resources.sh\n`\n\nBefore running install script, please make sure that cluster is running fine.\n\nYou can execute following command to download tb-node logs:\n\n`\n$ ./k8s-tb-node-logs.sh\n`\n\nThis script will create **tb-node-logs** folder, which will contain latest tb-node logs. Please search for any **ERROR** inside log files. If no errors, you can go to next steps.\n\nNext step we are going create devices and gateways.\n\nPlease update *k8s-install-performance.sh* file and set required number of gateways, devices and test api (device directly connected or device connected over gateway api):\n - *deviceStartIdx=${1:-0}* - device start index to create from\n - *deviceEndIdx=${2:-1000000}* - device end index\n - *gatewayStartIdx=${3:-0}* - gateway start index to create from\n - *gatewayEndIdx=${4:-0}* - gateway end index\n - testApi=${5:-device} - please set **'device'** if you would like to use device API or change it to **'gateway'** if you would like to use gateway API\n\nOnce you have updated file accordingly to your test case, execute the following command to install performance data:\n\n`\n$ ./k8s-install-performance.sh\n`\n\n### Gateway API test\n\nIn case you would like to validate gateway API case, please execute next commands and skip **Device API test** section. \n\nIf you would like to validate device API case, please skip this section and go to **Device API test** section.\n\nExecute the following command to start performance test for first 50000 Gateways:\n\n`\n$ ./k8s-run-performance.sh\n`\n\nExecute the following command to start performance test for the next 50000 Gateways:\n\n`\n$ ./k8s-run-performance2.sh\n`\n### Device API test\n\nExecute the following command to start pefrormance test for 1000000 Devices:\n\n`\n$ ./k8s-run-performance-clients.sh\n`\n\n### Test results\n\nAfter a while when all resources will be successfully started you can open `http://{your-cluster-ip}` in you browser (for ex. `http://192.168.99.101`).\nYou should see ThingsBoard login page.\n\nExecute the following command to get your cluster web ui host information:\n\n`\n$ kubectl get services ingress-nginx -owide --namespace kube-ingress\n`\n\nOR:\n\n`\n$ kubectl get ingress.extensions\n`\n\nUse the following default credentials:\n\n- **System Administrator**: sysadmin@thingsboard.org / sysadmin\n\nIf you installed DataBase with demo data (using `--loadDemo` flag) you can also use the following credentials:\n\n- **Tenant Administrator**: tenant@thingsboard.org / tenant\n- **Customer User**: customer@thingsboard.org / customer\n\nIn case of any issues you can examine service logs for errors.\nFor example to see ThingsBoard node logs execute the following commands:\n\n1) Get list of the running tb-node pods:\n\n`\n$ kubectl get pods -l app=tb-node\n`\n\n2) Fetch logs of tb-node pod:\n\n`\n$ kubectl logs -f [tb-node-pod-name]\n`\n\nWhere:\n\n- `tb-node-pod-name` - tb-node pod name obtained from the list of the running tb-node pods.\n\nOr use `kubectl get pods` to see the state of all the pods.\nOr use `kubectl get services` to see the state of all the services.\nOr use `kubectl get deployments` to see the state of all the deployments.\nSee [kubectl Cheat Sheet](https://kubernetes.io/docs/reference/kubectl/cheatsheet/) command reference for details.\n\nUse the following command to get pods and associated nodes:\n\n`\n$ kubectl get pod -o=custom-columns=NODE:.spec.nodeName,NAME:.metadata.name --all-namespaces\n`\n\n## Upgrading\n\nIn case when database upgrade is needed, execute the following commands:\n\n```\n$ ./k8s-delete-resources.sh\n$ ./k8s-upgrade-tb.sh --fromVersion=[FROM_VERSION]\n$ ./k8s-deploy-resources.sh\n```\n\nWhere:\n\n- `FROM_VERSION` - from which version upgrade should be started. See [Upgrade Instructions](https://thingsboard.io/docs/user-guide/install/upgrade-instructions) for valid `fromVersion` values.\n\n## Uninstallation\n\nExecute the following command to delete all deployed microservices:\n\n`\n$ ./k8s-delete-resources.sh\n`\n\nExecute the following command to delete all resources (including database):\n\n`\n$ ./k8s-delete-all.sh\n`\n\n## Delete cluster\n\nExecute the following command to completely delete cluster:\n\n`\n$ ./cluster-delete.sh\n`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingsboard%2Ftb-k8s-perf-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthingsboard%2Ftb-k8s-perf-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingsboard%2Ftb-k8s-perf-tests/lists"}