Skip to content

Commit e960496

Browse files
committed
feat: updated documentation
1 parent d829948 commit e960496

File tree

4 files changed

+57
-6
lines changed

4 files changed

+57
-6
lines changed

helm/timescaledb/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,28 @@ CREATE DATABASE k6loadtests;
2121

2222
CREATE EXTENSION IF NOT EXISTS timescaledb;
2323
```
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)

k6/k6-runner/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ config:
88

99
.PHONY: run_job
1010
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 -
1212

13-
.PHONY: delete
14-
delete:
13+
.PHONY: cleanup
14+
cleanup:
1515
oc -n $(NAMESPACE) delete job sso-k6
1616
oc -n $(NAMESPACE) delete configmap k6-config

k6/k6-runner/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
```

k6/k6-runner/openshift/k6/dc.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,12 @@ parameters:
4747
value: dev
4848
- name: IMAGE_REPOSITORY
4949
value: ghcr.io/bcgov/sso-k6-runner
50-
- name: HTTP_DEBUG
51-
description: enable http debug logging in the k6 pod
52-
value: 'false'
5350
- name: DB_USER
5451
value: ''
52+
required: true
5553
- name: DB_PASSWORD
5654
value: ''
55+
required: true
5756
- name: DB_NAME
5857
value: 'k6loadtests'
5958
- name: DB_HOST

0 commit comments

Comments
 (0)