forked from pixie-io/pixie
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclient_deployment.yaml
More file actions
77 lines (76 loc) · 2.29 KB
/
client_deployment.yaml
File metadata and controls
77 lines (76 loc) · 2.29 KB
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
69
70
71
72
73
74
75
76
77
---
apiVersion: v1
kind: ConfigMap
metadata:
name: wrk-config
namespace: px-protocol-loadtest
data:
wrk.lua: |
wrk.method = "POST"
wrk.body = "{\"body_size\":12288, \"header_size\":1024, \"chunk_size\":12288}"
wrk.headers["Content-Type"] = "application/json"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wrk
namespace: px-protocol-loadtest
spec:
replicas: 1
selector:
matchLabels:
name: wrk
template:
metadata:
labels:
name: wrk
spec:
initContainers:
- name: server-wait
# yamllint disable-line rule:line-length
image: ghcr.io/pixie-io/pixie-oss-pixie-dev-public-curl:8.15.0@sha256:4026b29997dc7c823b51c164b71e2b51e0fd95cce4601f78202c513d97da2922
# yamllint disable rule:line-length
command: ['sh', '-c', 'set -xe;
URL="${PROTOCOL}://${SERVICE_NAME}:${SERVICE_PORT}${HEALTH_PATH}";
until [ $(curl -m 0.5 -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" --data {} ${URL}) -eq 200 ]; do
echo "waiting for ${URL}";
sleep 2;
done;']
# yamllint enable rule:line-length
env:
- name: SERVICE_NAME
value: "server"
- name: SERVICE_PORT
value: "8080"
- name: HEALTH_PATH
value: ""
- name: PROTOCOL
value: "http"
containers:
- name: app
image: gcr.io/pixie-oss/pixie-dev/src/e2e_test/protocol_loadtest/http/wrk:latest
# yamllint disable rule:line-length
command: ['sh', '-c', 'set -xe;
while true; do
wrk -t${NUM_THREADS} -c${NUM_CONNECTIONS} -d${DURATION} -s/config/wrk.lua http://${SERVICE_NAME}:${SERVICE_PORT};
done;']
# yamllint enable rule:line-length
env:
- name: SERVICE_NAME
value: "server"
- name: SERVICE_PORT
value: "8080"
- name: NUM_CONNECTIONS
value: "10"
- name: NUM_THREADS
value: "10"
# duration doesn't really matter because the load generator is called in a loop.
- name: DURATION
value: "1m"
volumeMounts:
- name: config-volume
mountPath: /config
volumes:
- name: config-volume
configMap:
name: wrk-config