Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated jmeter config for kuda test cluster #40

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion GrafanaJMeterTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@
"multi": false,
"name": "retention",
"options": [],
"query": "SHOW RETENTION POLICIES ON \"jmeterdb\"",
"query": "SHOW RETENTION POLICIES ON \"jmeter\"",
"refresh": 1,
"regex": "",
"sort": 0,
Expand Down
10 changes: 8 additions & 2 deletions dashboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
working_dir=`pwd`

#Get namesapce variable
tenant=`awk '{print $NF}' $working_dir/tenant_export`
# tenant=`awk '{print $NF}' $working_dir/tenant_export`
tenant='testing'

## Create jmeter database automatically in Influxdb

Expand Down Expand Up @@ -32,4 +33,9 @@ kubectl exec -ti -n $tenant $master_pod -- chmod 755 /jmeter/load_test

##kubectl cp $working_dir/influxdb-jmeter-datasource.json -n $tenant $grafana_pod:/influxdb-jmeter-datasource.json

kubectl exec -ti -n $tenant $grafana_pod -- curl 'http://admin:admin@127.0.0.1:3000/api/datasources' -X POST -H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"name":"jmeterdb","type":"influxdb","url":"http://jmeter-influxdb:8086","access":"proxy","isDefault":true,"database":"jmeter","user":"admin","password":"admin"}'
# kubectl exec -ti -n $tenant $grafana_pod -- curl 'http://admin:admin@127.0.0.1:3000/api/datasources' -X POST -H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"name":"jmeterdb","type":"influxdb","url":"http://jmeter-influxdb:8086","access":"proxy","isDefault":true,"database":"jmeter","user":"admin","password":"admin"}'

grafana_dns=`kubectl get svc -n $tenant | grep jmeter-grafana | awk '{print $4}'`

echo "Creating Datasource for jmeter..."
curl 'http://admin:admin@'${grafana_dns}':3000/api/datasources' -X POST -H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"name":"jmeterdb","type":"influxdb","url":"http://jmeter-influxdb:8086","access":"proxy","isDefault":true,"database":"jmeter","user":"admin","password":"admin"}'
10 changes: 10 additions & 0 deletions jmeter_grafana_configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-config
labels:
app: jmeter-grafana
data:
custom.ini: |
[plugin.grafana-image-renderer]
rendering_ignore_https_errors = true
53 changes: 51 additions & 2 deletions jmeter_grafana_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ spec:
spec:
containers:
- name: grafana
image: grafana/grafana:5.2.0
image: grafana/grafana:latest
imagePullPolicy: IfNotPresent
# volumeMounts:
# - name: config-volume
# mountPath: /etc/grafana/custom.ini
ports:
- containerPort: 3000
protocol: TCP
Expand All @@ -33,4 +36,50 @@ spec:
- name: GF_SERVER_ROOT_URL
# If you're only using the API Server proxy, set this value instead:
# value: /api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
value: /
value: http://jmeter-grafana:3000/ #/
- name: GF_PLUGIN_GRAFANA_IMAGE_RENDERER_RENDERING_IGNORE_HTTPS_ERRORS
value: "true"
- name: GF_RENDERING_SERVER_URL
value: http://image-renderer:8081/render
- name: GF_RENDERING_CALLBACK_URL
value: http://jmeter-grafana:3000/
- name: GF_LOG_FILTERS
value: "rendering:debug"
# volumes:
# - name: config-volume
# configMap:
# name: grafana-config


---

apiVersion: apps/v1
kind: Deployment
metadata:
name: image-renderer
labels:
app: image-renderer
spec:
replicas: 1
selector:
matchLabels:
app: image-renderer
template:
metadata:
labels:
app: image-renderer
spec:
containers:
- name: image-renderer
image: grafana/grafana-image-renderer:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8081
protocol: TCP
env:
- name: ENABLE_METRICS
value: "true"
- name: LOG_LEVEL
value: debug
- name: RENDERING_VERBOSE_LOGGING
value: "true"
4 changes: 2 additions & 2 deletions jmeter_grafana_reporter.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta2 # for versions before 1.9.0 use apps/v1beta2
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: jmeter-reporter
Expand Down Expand Up @@ -34,4 +34,4 @@ spec:
targetPort: 8686
selector:
jmeter_mode: reporter
type: NodePort
type: LoadBalancer
18 changes: 17 additions & 1 deletion jmeter_grafana_svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,20 @@ spec:
targetPort: 3000
selector:
app: jmeter-grafana
type: NodePort
type: LoadBalancer

---

apiVersion: v1
kind: Service
metadata:
name: image-renderer
labels:
app: image-renderer
spec:
ports:
- port: 8081
targetPort: 8081
selector:
app: image-renderer
type: ClusterIP
2 changes: 1 addition & 1 deletion jmeter_influxdb_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
app: influxdb-jmeter
spec:
containers:
- image: influxdb
- image: influxdb:1.8.6
imagePullPolicy: IfNotPresent
name: influxdb
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion jmeter_slaves_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
labels:
jmeter_mode: slave
spec:
replicas: 2
replicas: 4
selector:
matchLabels:
jmeter_mode: slave
Expand Down
Loading