forked from helm/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add distributed JMeter chart (helm#8119)
* Adds Distributed JMeter chart: - Creates deployment resource for the JMeter master and server - Creates service resource for JMeter server Signed-off-by: Pedro César de Azevedo <[email protected]> * Fix blank space. Adds some documentation as well. Signed-off-by: Pedro César de Azevedo <[email protected]> * Added Documentation to the chart! - Adds a better README file - Also creates a NOTES.txt with instructionto run the tests - Changed logic to pull Docker image Signed-off-by: Pedro César de Azevedo <[email protected]> * Fix blank spaces Signed-off-by: Pedro César de Azevedo <[email protected]> * Applying changes Signed-off-by: Pedro César de Azevedo <[email protected]> * Fix app version Signed-off-by: Pedro César de Azevedo <[email protected]> * Use 1.0.0 for a start since we are stable Signed-off-by: Reinhard Nägele <[email protected]> * Add role label to service Signed-off-by: Reinhard Nägele <[email protected]> * Fixed labels and templates definitions. Signed-off-by: Pedro César de Azevedo <[email protected]> * Replaced role label Signed-off-by: Pedro César de Azevedo <[email protected]>
- Loading branch information
1 parent
2d9a357
commit a205f96
Showing
10 changed files
with
228 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
OWNERS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
appVersion: "3.3" | ||
description: A Distributed JMeter Helm chart | ||
name: distributed-jmeter | ||
version: 1.0.0 | ||
home: http://jmeter.apache.org/ | ||
icon: http://jmeter.apache.org/images/logo.svg | ||
sources: | ||
- https://github.com/pedrocesar-ti/distributed-jmeter-docker | ||
maintainers: | ||
- name: pedrocesar-ti | ||
email: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
approvers: | ||
- pedrocesar-ti | ||
reviewers: | ||
- pedrocesar-ti |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Distributed JMeter | ||
|
||
Based on the work done [here](https://github.com/pedrocesar-ti/distributed-jmeter-docker). | ||
|
||
Apache Jmeter™ is an open source tool that helps creating and running load test plans. This helm/chart was created to help you running different versions of JMeter in a distributed fashion (master -> server architecture), for more info. | ||
|
||
## Chart Details: | ||
This chart will do the following: | ||
- Deploy a JMeter master (by default 1) that is responsible to store the test plans and test results after running on the servers. | ||
- Deploy a JMeter server service (by default 3 replicas) that are responsible to run the actual test and send back the results to the master. | ||
|
||
|
||
## Installing the Chart: | ||
To install the chart with the release name jmeter: | ||
``` | ||
$ helm install --name distributed-jmeter stable/distributed-jmeter | ||
``` | ||
|
||
## Deploying different versions of JMeter | ||
The default [image](https://hub.docker.com/r/pedrocesarti/jmeter-docker/) allows you to run JMeter in all versions available. | ||
|
||
To change the version running on the helm you only need: | ||
``` | ||
$ helm install --name distributed-jmeter --set master.image.tag=4.0 --set server.image.tag=4.0 stable/distributed-jmeter | ||
``` | ||
|
||
Enjoy! :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
JMeter is now starting. | ||
|
||
|
||
To get get a shell session on the master you only need to run: | ||
|
||
$ export MASTER_NAME=$(kubectl get pods -l role=master -o jsonpath='{.items[*].metadata.name}') | ||
$ kubectl exec -it $MASTER_NAME -- /bin/bash | ||
|
||
|
||
To copy your test plans to the master pod: | ||
$ kubectl cp sample.jmx $MASTER_NAME:/jmeter | ||
|
||
|
||
To run your test in all servers you need first a list of all servers IPs (comma-separated) and then you can run your test: | ||
$ export SERVER_IPS=$(kubectl get pods -lrole=server -o jsonpath='{.items[*].status.podIP}' | tr ' ' ',') | ||
$ kubectl exec -it $MASTER_NAME -- jmeter -n -t /jmeter/sample.jmx -R $SERVER_IPS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "distributed-jmeter.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "distributed-jmeter.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "distributed-jmeter.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} |
34 changes: 34 additions & 0 deletions
34
stable/distributed-jmeter/templates/jmeter-master-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "distributed-jmeter.fullname" . }}-master | ||
labels: | ||
app.kubernetes.io/name: {{ include "distributed-jmeter.name" . }} | ||
helm.sh/chart: {{ include "distributed-jmeter.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/component: master | ||
spec: | ||
replicas: {{ .Values.master.replicaCount }} | ||
strategy: | ||
type: RollingUpdate | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: {{ include "distributed-jmeter.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/component: master | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: {{ include "distributed-jmeter.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/component: master | ||
spec: | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
args: | ||
- master | ||
ports: | ||
- containerPort: 60000 |
34 changes: 34 additions & 0 deletions
34
stable/distributed-jmeter/templates/jmeter-server-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "distributed-jmeter.fullname" . }}-server | ||
labels: | ||
app.kubernetes.io/name: {{ include "distributed-jmeter.name" . }} | ||
helm.sh/chart: {{ include "distributed-jmeter.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/component: server | ||
spec: | ||
replicas: {{ .Values.server.replicaCount }} | ||
strategy: | ||
type: RollingUpdate | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: {{ include "distributed-jmeter.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/component: server | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: {{ include "distributed-jmeter.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/component: server | ||
spec: | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
args: ["server"] | ||
ports: | ||
- containerPort: 50000 | ||
- containerPort: 1099 |
23 changes: 23 additions & 0 deletions
23
stable/distributed-jmeter/templates/jmeter-server-service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ template "distributed-jmeter.fullname" . }}-server | ||
labels: | ||
app.kubernetes.io/name: {{ include "distributed-jmeter.name" . }} | ||
helm.sh/chart: {{ include "distributed-jmeter.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/component: server | ||
spec: | ||
clusterIP: None | ||
ports: | ||
- port: 50000 | ||
protocol: TCP | ||
name: tcp-50000 | ||
- port: 1099 | ||
protocol: TCP | ||
name: tcp-1099 | ||
selector: | ||
app.kubernetes.io/name: {{ include "distributed-jmeter.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/component: server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Default values for distributed-jmeter. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
|
||
master: | ||
## The number of pods in the master deployment | ||
replicaCount: 1 | ||
|
||
server: | ||
## The number of pods in the server deployment | ||
replicaCount: 3 | ||
|
||
image: | ||
## Specify an imagePullPolicy | ||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images | ||
pullPolicy: IfNotPresent | ||
|
||
## The repository and image | ||
## ref: https://hub.docker.com/r/pedrocesarti/jmeter-docker/ | ||
repository: "pedrocesarti/jmeter-docker" | ||
|
||
## The tag for the image | ||
## ref: https://hub.docker.com/r/pedrocesarti/jmeter-docker/tags/ | ||
tag: 3.3 |