Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

updating locust to use Locust v0.9.0 #8066

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stable/locust/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: locust
description: A modern load testing framework
version: 0.3.0
appVersion: 0.7.5
version: 0.4.0
appVersion: 0.9.0
maintainers:
- name: so0k
email: vincent.drl@gmail.com
Expand Down
10 changes: 5 additions & 5 deletions stable/locust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ testing using Kubernetes.

## Pre Requisites:

* Requires (and tested with) helm `v2.1.2` or above.
* Requires (and tested with) helm `v2.10.2` or above.

## Chart details

Expand All @@ -21,20 +21,20 @@ This chart will do the following:
To install the chart with the release name `locust-nymph` in the default namespace:

```bash
helm install -n locust-nymph --set master.config.target-host=http://site.example.com stable/locust
helm install -n locust-nymph --set master.config.target-url=http://site.example.com stable/locust
```

| Parameter | Description | Default |
| ---------------------------- | ---------------------------------- | ----------------------------------------------------- |
| `Name` | Locust master name | `locust` |
| `image.repository` | Locust container image name | `quay.io/honestbee/locust` |
| `image.repository` | Locust container image name | `garland/locust` |
| `image.tag` | Locust Container image tag | `0.7.5` |
| `image.pullSecrets` | Locust Container image registry secret | `None` |
| `service.type` | k8s service type exposing master | `NodePort` |
| `service.nodePort` | Port on cluster to expose master | `0` |
| `service.annotations` | KV containing custom annotations | `{}` |
| `service.extraLabels` | KV containing extra labels | `{}` |
| `master.config.target-host` | locust target host | `http://site.example.com` |
| `service.extraLabels` | KV containing extra labels | `{}` |\
| `master.config.target-url` | locust target host | `http://site.example.com` |
| `worker.config.locust-script`| locust script to run | `/locust-tasks/tasks.py` |
| `worker.replicaCount` | Number of workers to run | `2` |

Expand Down
11 changes: 7 additions & 4 deletions stable/locust/templates/master-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "locust.master" . }}
Expand All @@ -10,6 +10,10 @@ metadata:
component: master
spec:
replicas: 1
selector:
matchLabels:
component: master
app: {{ template "locust.fullname" . }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
app: {{ template "locust.fullname" . }}
app: {{ template "locust.fullname" . }}
release: {{ .Release.Name | quote }}

strategy:
type: RollingUpdate
rollingUpdate:
Expand All @@ -30,16 +34,15 @@ spec:
- name: locust
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["-f", "$(LOCUSTFILE_PATH)", "-H", "$(TARGET_URL)", "--master"]
resources:
{{ toYaml .Values.worker.resources | indent 10 }}
env:
{{- range $key, $value := .Values.master.config }}
- name: {{ $key | upper | replace "-" "_" }}
value: {{ $value | quote }}
{{- end }}
- name: LOCUST_MODE
value: "master"
- name: LOCUST_SCRIPT
- name: LOCUSTFILE_PATH
value: {{ index .Values.worker.config "locust-script" | quote }}
ports:
- containerPort: {{ .Values.service.internalPort }}
Expand Down
17 changes: 9 additions & 8 deletions stable/locust/templates/worker-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "locust.worker" . }}
Expand All @@ -10,6 +10,10 @@ metadata:
component: worker
spec:
replicas: {{ default 2 .Values.worker.replicaCount }}
selector:
matchLabels:
component: worker
app: {{ template "locust.fullname" . }}
strategy:
type: RollingUpdate
rollingUpdate:
Expand All @@ -29,6 +33,7 @@ spec:
- name: locust
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["-f", "$(LOCUST_SCRIPT)", "-H", "$(TARGET_URL)", "--slave", "--master-host=$(LOCUST_MASTER_HOST)", "--master-port=5557"]
volumeMounts:
- name: locust-tasks
mountPath: /locust-tasks/
Expand All @@ -37,14 +42,10 @@ spec:
- name: {{ $key | upper | replace "-" "_" }}
value: {{ $value | quote }}
{{- end }}
- name: LOCUST_MODE
value: "worker"
- name: LOCUST_MASTER
- name: LOCUST_MASTER_HOST
value: {{ template "locust.master-svc" . }}
- name: LOCUST_MASTER_WEB
value: "{{ .Values.service.internalPort }}"
- name: TARGET_HOST
value: {{ index .Values.master.config "target-host" | quote }}
- name: TARGET_URL
value: {{ index .Values.master.config "target-url" | quote }}
resources:
{{ toYaml .Values.worker.resources | indent 10 }}
restartPolicy: Always
Expand Down
6 changes: 3 additions & 3 deletions stable/locust/values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Name: locust

image:
repository: quay.io/honestbee/locust
tag: 0.7.5
repository: garland/locust
tag: 0.9.0
pullPolicy: IfNotPresent
pullSecrets: []

Expand All @@ -16,7 +16,7 @@ service:
extraLabels: {}
master:
config:
target-host: https://site.example.com
target-url: https://site.example.com
resources:
limits:
cpu: 100m
Expand Down