From b3c261cea146f6a91807db09e0d6eddfd0644df5 Mon Sep 17 00:00:00 2001 From: Miguel Elias dos Santos Date: Sat, 12 May 2018 18:07:26 +1000 Subject: [PATCH] Feature/add extra labels and annotations locust (#5203) * Added custom labels and annotations to locust service definition * Bumped up the version and fixed docs * Removing default value for annotations and labels from locust chart * Fixing locust svc template * Fixed annotations rendering on locust master-svc * Fixes naming convention for values and bumped up the version * Fixing Chart version --- stable/locust/Chart.yaml | 2 +- stable/locust/README.md | 2 ++ stable/locust/templates/master-svc.yaml | 9 +++++++++ stable/locust/values.yaml | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/stable/locust/Chart.yaml b/stable/locust/Chart.yaml index 80dd7fb2f2..597096725a 100644 --- a/stable/locust/Chart.yaml +++ b/stable/locust/Chart.yaml @@ -1,6 +1,6 @@ name: locust description: A modern load testing framework -version: 0.1.4 +version: 0.2.0 appVersion: 0.7.5 maintainers: - name: Vincent De Smet diff --git a/stable/locust/README.md b/stable/locust/README.md index 0cf62b0f97..c06cb73336 100644 --- a/stable/locust/README.md +++ b/stable/locust/README.md @@ -31,6 +31,8 @@ helm install -n locust-nymph --set master.config.target-host=http://site.example | `image.tag` | Locust Container image tag | `0.7.5` | | `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` | | `worker.config.locust-script`| locust script to run | `/locust-tasks/tasks.py` | | `worker.replicaCount` | Number of workers to run | `2` | diff --git a/stable/locust/templates/master-svc.yaml b/stable/locust/templates/master-svc.yaml index 94387662bf..657d315ce3 100644 --- a/stable/locust/templates/master-svc.yaml +++ b/stable/locust/templates/master-svc.yaml @@ -8,6 +8,15 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" app: {{ template "locust.fullname" . }} component: "master" + {{- range $key, $value := .Values.service.extraLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.service.annotations }} + annotations: + {{- range $key, $value := .Values.service.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} spec: type: {{ .Values.service.type }} ports: diff --git a/stable/locust/values.yaml b/stable/locust/values.yaml index fe7b7c8d14..3d90629d82 100644 --- a/stable/locust/values.yaml +++ b/stable/locust/values.yaml @@ -11,6 +11,8 @@ service: externalPort: 8089 internalPort: 8089 nodePort: 0 + annotations: {} + extraLabels: {} master: config: target-host: https://site.example.com