Kubernetes/Helm/Helm部署Locust.md
offends 7a2f41e7d6
All checks were successful
continuous-integration/drone Build is passing
synchronization
2024-08-07 18:54:39 +08:00

74 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

> 本文作者:丁辉
# Helm部署Locust
[官方文档](https://locust.io/)
[Github仓库](https://github.com/locustio/locust)
[官方推荐的HelmChart仓库](https://github.com/deliveryhero/helm-charts/tree/master/stable/locust)
## 介绍
Locust 是一个开源的性能测试工具它主要用于测试网站或网络应用程序的负载能力和性能。与其他性能测试工具不同Locust 使用 Python 语言进行测试脚本的编写,这使得它更灵活和易于使用。
## 开始部署
1. 添加 Helm 仓库
```bash
helm repo add deliveryhero https://charts.deliveryhero.io/
helm repo update
```
2. 编写 values.yaml 文件
```bash
vi locust-values.yaml
```
内容如下
```yaml
ingress:
enabled: true
className: ""
hosts:
- host: # 域名
pathType: ImplementationSpecific
path: /
tls:
- secretName: locust-tls
hosts:
- # 域名
image:
repository: locustio/locust
tag: latest
```
3. 安装
```bash
helm install locust \
--namespace locust \
--create-namespace \
deliveryhero/locust \
-f locust-values.yaml
```
## 卸载
1. 卸载 Locust
```bash
helm uninstall locust -n locust
```
2. 删除命名空间
```bash
kubectl delete ns locust
```