Skip to content

Commit

Permalink
Merge pull request #195 from zeebe-io/ck-saas-support
Browse files Browse the repository at this point in the history
Introduce SaaS support for benchmarks
  • Loading branch information
ChrisKujawa authored Sep 20, 2024
2 parents 3e08eb7 + 9e618b4 commit 9dfa5e9
Show file tree
Hide file tree
Showing 11 changed files with 470 additions and 1 deletion.
13 changes: 13 additions & 0 deletions charts/zeebe-benchmark/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}

{{/*
Create a default fully qualified credentials name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "zeebe-benchmark.credentials-name" -}}
{{- if .Values.saas.credentials.existingSecret }}
{{- .Values.saas.credentials.existingSecret }}
{{- else }}
{{- printf "%s-credentials" .Release.Name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}


{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down
12 changes: 12 additions & 0 deletions charts/zeebe-benchmark/templates/credentials.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if and .Values.saas.enabled (not .Values.saas.credentials.existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "zeebe-benchmark.credentials-name" .}}
type: Opaque
stringData:
clientId: {{ .Values.saas.credentials.clientId }}
clientSecret: {{ .Values.saas.credentials.clientSecret }}
zeebeAddress: {{ .Values.saas.credentials.zeebeAddress }}
authServer: {{ .Values.saas.credentials.authServer }}
{{- end }}
28 changes: 27 additions & 1 deletion charts/zeebe-benchmark/templates/starter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ spec:
- name: JDK_JAVA_OPTIONS
value: >-
-Dconfig.override_with_env_vars=true
-Dapp.brokerUrl={{ .Release.Name }}-zeebe-gateway:26500
{{- if $.Values.saas.enabled }}
-Dapp.tls=true
{{- else }}
-Dapp.brokerUrl={{ $.Release.Name }}-zeebe-gateway:26500
{{- end }}
-Dapp.starter.rate={{ .Values.starter.rate }}
-Dapp.starter.durationLimit=0
-Dzeebe.client.requestTimeout=62000
Expand All @@ -47,6 +51,28 @@ spec:
- name: LOG_LEVEL
value: {{ .Values.starter.logLevel | quote }}
{{- end }}
{{- if $.Values.saas.enabled }}
- name: ZEEBE_ADDRESS
valueFrom:
secretKeyRef:
name: {{ include "zeebe-benchmark.credentials-name" $ }}
key: zeebeAddress
- name: ZEEBE_CLIENT_ID
valueFrom:
secretKeyRef:
name: {{ include "zeebe-benchmark.credentials-name" $ }}
key: clientId
- name: ZEEBE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: {{ include "zeebe-benchmark.credentials-name" $ }}
key: clientSecret
- name: ZEEBE_AUTHORIZATION_SERVER_URL
valueFrom:
secretKeyRef:
name: {{ include "zeebe-benchmark.credentials-name" $ }}
key: authServer
{{- end }}
envFrom:
- configMapRef:
name: starter-config
Expand Down
26 changes: 26 additions & 0 deletions charts/zeebe-benchmark/templates/workers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ spec:
- name: JDK_JAVA_OPTIONS
value: >-
-Dconfig.override_with_env_vars=true
{{- if $.Values.saas.enabled }}
-Dapp.tls=true
{{- else }}
-Dapp.brokerUrl={{ $.Release.Name }}-zeebe-gateway:26500
{{- end }}
-Dzeebe.client.requestTimeout=62000
{{- if $worker.capacity }}
-Dapp.worker.capacity={{ $worker.capacity }}
Expand All @@ -51,6 +55,28 @@ spec:
- name: LOG_LEVEL
value: {{ $worker.logLevel | quote }}
{{- end }}
{{- if $.Values.saas.enabled }}
- name: ZEEBE_ADDRESS
valueFrom:
secretKeyRef:
name: {{ include "zeebe-benchmark.credentials-name" $ }}
key: zeebeAddress
- name: ZEEBE_CLIENT_ID
valueFrom:
secretKeyRef:
name: {{ include "zeebe-benchmark.credentials-name" $ }}
key: clientId
- name: ZEEBE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: {{ include "zeebe-benchmark.credentials-name" $ }}
key: clientSecret
- name: ZEEBE_AUTHORIZATION_SERVER_URL
valueFrom:
secretKeyRef:
name: {{ include "zeebe-benchmark.credentials-name" $ }}
key: authServer
{{- end }}
{{- if $worker.resources }}
resources:
{{- toYaml $worker.resources | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Source: zeebe-benchmark/templates/credentials.yaml
apiVersion: v1
kind: Secret
metadata:
name: benchmark-test-credentials
type: Opaque
stringData:
clientId: clientId
clientSecret: clientSecret
zeebeAddress: zeebeAddress
authServer: authServer
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
# Source: zeebe-benchmark/templates/starter.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: starter
labels:
app: starter
spec:
selector:
matchLabels:
app: starter
replicas: 1
template:
metadata:
labels:
app: starter
app.kubernetes.io/component: zeebe-client
spec:
containers:
- name: starter
image: "gcr.io/zeebe-io/starter:SNAPSHOT"
imagePullPolicy: Always
env:
- name: JDK_JAVA_OPTIONS
value: >-
-Dconfig.override_with_env_vars=true
-Dapp.tls=true
-Dapp.starter.rate=150
-Dapp.starter.durationLimit=0
-Dzeebe.client.requestTimeout=62000
-Dapp.starter.processId="benchmark"
-Dapp.starter.bpmnXmlPath="bpmn/one_task.bpmn"
-Dapp.starter.businessKey="businessKey"
-Dapp.starter.payloadPath="bpmn/big_payload.json"
-XX:+HeapDumpOnOutOfMemoryError
- name: LOG_LEVEL
value: "WARN"
- name: ZEEBE_ADDRESS
valueFrom:
secretKeyRef:
name: benchmark-test-credentials
key: zeebeAddress
- name: ZEEBE_CLIENT_ID
valueFrom:
secretKeyRef:
name: benchmark-test-credentials
key: clientId
- name: ZEEBE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: benchmark-test-credentials
key: clientSecret
- name: ZEEBE_AUTHORIZATION_SERVER_URL
valueFrom:
secretKeyRef:
name: benchmark-test-credentials
key: authServer
envFrom:
- configMapRef:
name: starter-config
optional: true
resources:
limits:
cpu: 250m
memory: 256Mi
requests:
cpu: 250m
memory: 256Mi
ports:
- containerPort: 9600
name: "http"
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
# Source: zeebe-benchmark/templates/workers.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: benchmark-worker
labels:
app: benchmark-worker
spec:
selector:
matchLabels:
app: benchmark-worker
replicas: 3
template:
metadata:
labels:
app: benchmark-worker
app.kubernetes.io/component: zeebe-client
spec:
containers:
- name: benchmark-worker
image: "gcr.io/zeebe-io/worker:SNAPSHOT"
imagePullPolicy: Always
env:
- name: JDK_JAVA_OPTIONS
value: >-
-Dconfig.override_with_env_vars=true
-Dapp.tls=true
-Dzeebe.client.requestTimeout=62000
-Dapp.worker.capacity=60
-Dapp.worker.pollingDelay=1ms
-Dapp.worker.completionDelay=50ms
-Dapp.worker.workerName="benchmark"
-Dapp.worker.jobType="benchmark-task"
-Dapp.worker.payloadPath="bpmn/big_payload.json"
-Dapp.worker.completionDelay=50ms
-XX:+HeapDumpOnOutOfMemoryError
- name: LOG_LEVEL
value: "WARN"
- name: ZEEBE_ADDRESS
valueFrom:
secretKeyRef:
name: benchmark-test-credentials
key: zeebeAddress
- name: ZEEBE_CLIENT_ID
valueFrom:
secretKeyRef:
name: benchmark-test-credentials
key: clientId
- name: ZEEBE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: benchmark-test-credentials
key: clientSecret
- name: ZEEBE_AUTHORIZATION_SERVER_URL
valueFrom:
secretKeyRef:
name: benchmark-test-credentials
key: authServer
resources:
limits:
cpu: 500m
memory: 256Mi
requests:
cpu: 500m
memory: 256Mi
ports:
- containerPort: 9600
name: "http"
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
# Source: zeebe-benchmark/templates/starter.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: starter
labels:
app: starter
spec:
selector:
matchLabels:
app: starter
replicas: 1
template:
metadata:
labels:
app: starter
app.kubernetes.io/component: zeebe-client
spec:
containers:
- name: starter
image: "gcr.io/zeebe-io/starter:SNAPSHOT"
imagePullPolicy: Always
env:
- name: JDK_JAVA_OPTIONS
value: >-
-Dconfig.override_with_env_vars=true
-Dapp.tls=true
-Dapp.starter.rate=150
-Dapp.starter.durationLimit=0
-Dzeebe.client.requestTimeout=62000
-Dapp.starter.processId="benchmark"
-Dapp.starter.bpmnXmlPath="bpmn/one_task.bpmn"
-Dapp.starter.businessKey="businessKey"
-Dapp.starter.payloadPath="bpmn/big_payload.json"
-XX:+HeapDumpOnOutOfMemoryError
- name: LOG_LEVEL
value: "WARN"
- name: ZEEBE_ADDRESS
valueFrom:
secretKeyRef:
name: secret-name
key: zeebeAddress
- name: ZEEBE_CLIENT_ID
valueFrom:
secretKeyRef:
name: secret-name
key: clientId
- name: ZEEBE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: secret-name
key: clientSecret
- name: ZEEBE_AUTHORIZATION_SERVER_URL
valueFrom:
secretKeyRef:
name: secret-name
key: authServer
envFrom:
- configMapRef:
name: starter-config
optional: true
resources:
limits:
cpu: 250m
memory: 256Mi
requests:
cpu: 250m
memory: 256Mi
ports:
- containerPort: 9600
name: "http"
Loading

0 comments on commit 9dfa5e9

Please sign in to comment.