Skip to content

Commit

Permalink
Added secret locust-secrets with settings from .env
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredeen committed Apr 29, 2024
1 parent c2e56b5 commit 22b87fa
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,22 @@ $ ./run_test_plan.sh

## Use a custom built docker image

Copy the environment variables template file to .env and edit as needed. Then run:

cd ./source

docker build -t serve-load-testing .

docker run -p 8089:8089 serve-load-testing
docker run -p 8089:8089 --env-file ./.env serve-load-testing

## Deploy to kubernetes

### Using ArgoCD

Create a new ArgoCD app using the application manifest ./argocd/application.yaml

Edit the values of the secret locust-secrets in namespace locust as needed.

Create the secret locust-ui-secret (see section below) in namespace locust.

### Using CLI kubectl
Expand Down
10 changes: 10 additions & 0 deletions manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ spec:
image: ghcr.io/scilifelabdatacentre/serve-load-testing:main-20240419-1108
ports:
- containerPort: 8089
envFrom:
- secretRef:
name: locust-secrets
resources:
limits:
cpu: "1"
memory: "1Gi"
requests:
cpu: "250m"
memory: "64Mi"
11 changes: 11 additions & 0 deletions manifests/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: locust-secrets
type: Opaque
data:
SERVE_USERNAME: change-me
SERVE_PASS: change-me
SERVE_LOCUST_TEST_USER_PASS: cGFzc3dvcmQxMjM=
SERVE_LOCUST_DO_CREATE_OBJECTS: ZmFsc2U=
PROTECTED_PAGE_RELATIVE_URL: change-me
9 changes: 5 additions & 4 deletions source/locust-ui.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# locust-ui.conf
locustfile = tests/test_verify_host.py
locustfile = tests/test_plan_normal.py
headless = false
#master = true
#expect-workers = 5
only-summary = true
csv = stats/locust
loglevel = INFO
# Can be overridden in UI:
host = https://staging.serve-dev.scilifelab.se
users = 1
spawn-rate = 1
run-time = 10s
only-summary = true
csv = stats/locust
loglevel = INFO

0 comments on commit 22b87fa

Please sign in to comment.