Skip to content

Commit

Permalink
start doc
Browse files Browse the repository at this point in the history
  • Loading branch information
bcobzh committed Jul 18, 2024
1 parent 34299d2 commit dd7f5d3
Showing 1 changed file with 81 additions and 1 deletion.
82 changes: 81 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,82 @@
# k6-runner
k6 image for k6-operator

## Introduction

Image pour k6-operator ajoutant les extensions "redis" et "prometheus-rw"

## Installation

### K6 operator
```sh
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
helm install k6-operator grafana/k6-operator
```

## Configuration

### Prometheus

Prometheus doit être lancé avec l'option : `--web.enable-remote-write-receiver`

### Variables d'environnement

* Configmap

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: prometheus-config
namespace: k6-operator-system
data:
K6_PROMETHEUS_RW_SERVER_URL: http://<prometheus_url>:9090/api/v1/write
K6_PROMETHEUS_RW_TREND_STATS: "count,sum,min,max,avg,med"
```
* Secret (si utilisation de Redis avec Authentification)
```sh
kubectl create secret generic k6-secrets --from-literal REDIS_URL=redis://user:passwd@redis_url:6379
```
### Fichier de configuration du test

* k6-tmc.yaml
```yaml
apiVersion: k6.io/v1alpha1
kind: K6
metadata:
name: k6-tmc
spec:
parallelism: 1 # le target de test doit être au moins égale ceci
runner:
image: ghcr.io/cooptilleuls/k6-runner:main
envFrom:
- configMapRef:
name: prometheus-config
- secretRef:
name: k6-secrets
arguments: -o xk6-prometheus-rw
script:
configMap:
name: mon-test
file: "archive.tar"
```

## Lancement d'un TMC

* Suppression du test précédent
```sh
kubectl delete -f k6-tmc.yaml
kubectl delete configmaps reply-to-feedback
```
* Créer une Configmap contenant le test à lancer:
```sh
k6 archive Course/get_course_sheets.js
kubectl create configmap reply-to-feedback --from-file archive.tar
```

* Lancer le test
```
kubectl apply -f k6-tmc.yaml
```

0 comments on commit dd7f5d3

Please sign in to comment.