File tree Expand file tree Collapse file tree 4 files changed +57
-6
lines changed Expand file tree Collapse file tree 4 files changed +57
-6
lines changed Original file line number Diff line number Diff line change @@ -21,3 +21,28 @@ CREATE DATABASE k6loadtests;
21
21
22
22
CREATE EXTENSION IF NOT EXISTS timescaledb;
23
23
```
24
+
25
+ ### Grafana
26
+
27
+ - Existing [ grafana] ( https://sso-grafana-sandbox.apps.gold.devops.gov.bc.ca/ ) instance is being used to host the dashboards.
28
+ - Ensure a data source exists with below config.
29
+
30
+ ``` yaml
31
+ name : ' K6 Load Tests TimeScaleDB'
32
+ type : postgres
33
+ url : k6-patroni.xxx.svc.cluster.local:5432
34
+ database : k6loadtests
35
+ user : xxx
36
+ isDefault : false
37
+ secureJsonData :
38
+ password : xxx
39
+ jsonData :
40
+ sslmode : ' disable' # disable/require/verify-ca/verify-full
41
+ maxOpenConns : 0 # Grafana v5.4+
42
+ maxIdleConns : 2 # Grafana v5.4+
43
+ connMaxLifetime : 14400 # Grafana v5.4+
44
+ postgresVersion : 15
45
+ timescaledb : true
46
+ ` ` `
47
+
48
+ - Pre-built dashboards can be found [here](https://github.com/grafana/xk6-output-timescaledb/tree/main/grafana/dashboards)](https://github.com/grafana/xk6-output-timescaledb/tree/main/grafana/dashboards)
Original file line number Diff line number Diff line change 8
8
9
9
.PHONY : run_job
10
10
run_job :
11
- oc -n $(NAMESPACE ) process -f ./openshift/k6/dc.yaml | oc -n $(NAMESPACE ) apply -f -
11
+ oc -n $(NAMESPACE ) process -f ./openshift/k6/dc.yaml -p DB_PASSWORD= $( DB_PASSWORD ) -p DB_USER= $( DB_USER ) | oc -n $(NAMESPACE ) apply -f -
12
12
13
- .PHONY : delete
14
- delete :
13
+ .PHONY : cleanup
14
+ cleanup :
15
15
oc -n $(NAMESPACE ) delete job sso-k6
16
16
oc -n $(NAMESPACE ) delete configmap k6-config
Original file line number Diff line number Diff line change
1
+ # K6 Runner for Load Tests
2
+
3
+ ## Requirements
4
+
5
+ - ` k6-patroni ` timescaleDB built on top of postgreSQL managed by patroni
6
+ - ` grafana ` is the open source analytics & monitoring solution
7
+
8
+ ## Setup
9
+
10
+ - Ensure ` k6-patroni ` is running in ` c6af30-dev ` namespace as a statefulset
11
+ - Copy ` sso-keycloak/k6/k6-runner/src/config/config.example.json ` to ` sso-keycloak/k6/k6-runner/src/config/config.json ` and update values accordingly
12
+
13
+ ``` sh
14
+ # initialize env vars
15
+ export NAMESPACE=
16
+ export DB_USER=
17
+ export DB_PASSWORD=
18
+
19
+ # create configmap with all the configurations
20
+ make config
21
+
22
+ # create a job to run load tests
23
+ make run_job
24
+
25
+ # clean up job and config map
26
+ make cleanup
27
+ ```
Original file line number Diff line number Diff line change @@ -47,13 +47,12 @@ parameters:
47
47
value : dev
48
48
- name : IMAGE_REPOSITORY
49
49
value : ghcr.io/bcgov/sso-k6-runner
50
- - name : HTTP_DEBUG
51
- description : enable http debug logging in the k6 pod
52
- value : ' false'
53
50
- name : DB_USER
54
51
value : ' '
52
+ required : true
55
53
- name : DB_PASSWORD
56
54
value : ' '
55
+ required : true
57
56
- name : DB_NAME
58
57
value : ' k6loadtests'
59
58
- name : DB_HOST
You can’t perform that action at this time.
0 commit comments