forked from pablokbs/peladonerd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
02-locust.yaml
68 lines (63 loc) · 1.25 KB
/
02-locust.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
apiVersion: apps/v1
kind: Deployment
metadata:
name: locust
labels:
app: locust
spec:
replicas: 1
selector:
matchLabels:
app: locust
template:
metadata:
labels:
app: locust
spec:
containers:
- name: locust
image: locustio/locust:0.14.5
ports:
- containerPort: 8089
env:
- name: LOCUSTFILE_PATH
value: /locust/locustfile.py
- name: TARGET_URL
value: http://hello-svc:80
volumeMounts:
- name: locustfile-volume
mountPath: /locust
volumes:
- name: locustfile-volume
configMap:
name: locustfile
---
apiVersion: v1
kind: Service
metadata:
name: locust-svc
labels:
app: locust
spec:
selector:
app: locust
ports:
- name: web
protocol: TCP
port: 80
targetPort: 8089
---
apiVersion: v1
kind: ConfigMap
metadata:
name: locustfile
data:
locustfile.py: |-
from locust import HttpLocust, TaskSet, task, between
class UserBehavior(TaskSet):
@task
def get_something(self):
self.client.get("/")
class WebsiteUser(HttpLocust):
task_set = UserBehavior
wait_time = between(5, 9)