Skip to content

Commit 85f4ba5

Browse files
authored
Helm Chart for 5.0.5 (#24)
* Helm chart 5.0.5: Convert Pods to Jobs for improved orchestration Changes in this release: - Converted bandwidth Pod to Job for one-time test execution - Converted latency Pod to Job with post-install hook for automated testing - Updated Chart version to 5.0.5 - Enhanced StatefulSet configuration with improved resource management - Added new configuration options in values.yaml for test parameters - Fixed service port configuration to use integer type These changes provide better Kubernetes-native handling of test workloads, ensuring proper completion tracking and automatic cleanup of finished tests. * add helm hook to create bandwidth pod after hperf statefulset * update notes * add labels field * remove hooks * remove default * mount volume based on options: emptyDir, hostPath or volumeClaimTemplate * Set print all as default to true * Comment latency test by default and only print NOTES.txt instructions when latency is enabled * Re-run the Job OnFailure If the test fails because the hperf servers were not ready before the Job started, we should allow the container test to be recreated. * Bind IP to the server pods By binding the actual pod IP and not the `0.0.0.0` interface we can get mode detailed results of test
1 parent 12245dc commit 85f4ba5

File tree

8 files changed

+252
-12
lines changed

8 files changed

+252
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
dist
2+
.idea

helm/hperf/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: hperf
3-
description: Nperf is a tool for active measurements of the maximum achievable bandwidth between N peers, measuring RX/TX bandwidth for each peers.
3+
description: hperf is a tool for active measurements of the maximum achievable bandwidth between N peers, measuring RX/TX bandwidth for each peers.
44

55
# A chart can be either an 'application' or a 'library' chart.
66
#
@@ -15,10 +15,10 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: v4.0.5
18+
version: v5.0.5
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "4.0.5"
24+
appVersion: "5.0.5"

helm/hperf/templates/NOTES.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
---
2-
Look for `hperf` results with `kubectl logs`
2+
Look for `hperf` bandwidth results
33

4-
kubectl logs --namespace {{ .Release.Namespace }} --max-log-requests {{ .Values.replicaCount }} -l "app=hperf" -f
4+
kubectl logs --namespace {{ .Release.Namespace }} -l "app=hperf-bandwidth" -f
5+
6+
{{- if .Values.latency }}
7+
Look for `hperf` latency results
8+
9+
kubectl logs --namespace {{ .Release.Namespace }} -l "app=hperf-latency" -f
10+
{{- end }}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{{- if .Values.bandwidth }}
2+
apiVersion: batch/v1
3+
kind: Job
4+
metadata:
5+
name: {{ template "hperf.fullname" . }}-bandwidth
6+
namespace: {{ .Release.Namespace | quote }}
7+
labels:
8+
app: hperf-download
9+
{{- include "hperf.labels" . | nindent 4 }}
10+
spec:
11+
template:
12+
metadata:
13+
labels:
14+
app: hperf-bandwidth
15+
{{- include "hperf.labels" . | nindent 8 }}
16+
spec:
17+
{{- with .Values.imagePullSecrets }}
18+
imagePullSecrets:
19+
{{- toYaml . | nindent 8 }}
20+
{{- end }}
21+
serviceAccountName: {{ include "hperf.serviceAccountName" . }}
22+
securityContext:
23+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
24+
containers:
25+
- name: hperf-download
26+
securityContext:
27+
{{- toYaml .Values.securityContext | nindent 12 }}
28+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
29+
imagePullPolicy: {{ .Values.image.pullPolicy }}
30+
args:
31+
- "bandwidth"
32+
- "--hosts"
33+
- {{ range $i, $e := until ($.Values.replicaCount | int) -}}
34+
{{ template "hperf.fullname" $ }}-{{ $i }}.{{ template "hperf.fullname" $ }}.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}{{- if lt (add1 $i) ($.Values.replicaCount | int) }},{{ end -}}
35+
{{- end }}
36+
- "--port"
37+
- "{{ .Values.hperf.port }}"
38+
- "--duration"
39+
- "{{ .Values.bandwidth.duration }}"
40+
- "--concurrency"
41+
- "{{ .Values.bandwidth.concurrency }}"
42+
- "--id"
43+
- {{ .Values.bandwidth.id | default (include "hperf.fullname" .) | quote }}
44+
{{- if .Values.bandwidth.printAll }}
45+
- "--print-all"
46+
{{- end }}
47+
{{- if .Values.bandwidth.micro }}
48+
- "--micro"
49+
{{- end }}
50+
resources:
51+
{{- toYaml .Values.resources | nindent 12 }}
52+
{{- with .Values.nodeSelector }}
53+
nodeSelector:
54+
{{- toYaml . | nindent 8 }}
55+
{{- end }}
56+
{{- with .Values.affinity }}
57+
affinity:
58+
{{- toYaml . | nindent 8 }}
59+
{{- end }}
60+
{{- with .Values.tolerations }}
61+
tolerations:
62+
{{- toYaml . | nindent 8 }}
63+
{{- end }}
64+
restartPolicy: OnFailure
65+
{{- end }}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{{- if .Values.latency }}
2+
apiVersion: batch/v1
3+
kind: Job
4+
metadata:
5+
name: {{ template "hperf.fullname" . }}-latency
6+
namespace: {{ .Release.Namespace | quote }}
7+
labels:
8+
app: hperf-latency
9+
{{- include "hperf.labels" . | nindent 4 }}
10+
spec:
11+
template:
12+
metadata:
13+
labels:
14+
app: hperf-latency
15+
{{- include "hperf.labels" . | nindent 8 }}
16+
spec:
17+
{{- with .Values.imagePullSecrets }}
18+
imagePullSecrets:
19+
{{- toYaml . | nindent 8 }}
20+
{{- end }}
21+
serviceAccountName: {{ include "hperf.serviceAccountName" . }}
22+
securityContext:
23+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
24+
containers:
25+
- name: hperf-latency
26+
securityContext:
27+
{{- toYaml .Values.securityContext | nindent 12 }}
28+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
29+
imagePullPolicy: {{ .Values.image.pullPolicy }}
30+
args:
31+
- "latency"
32+
- "--hosts"
33+
- {{ range $i, $e := until ($.Values.replicaCount | int) -}}
34+
{{ template "hperf.fullname" $ }}-{{ $i }}.{{ template "hperf.fullname" $ }}.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}{{- if lt (add1 $i) ($.Values.replicaCount | int) }},{{ end -}}
35+
{{- end }}
36+
- "--port"
37+
- "{{ .Values.hperf.port }}"
38+
- "--id"
39+
- {{ .Values.latency.id | default (include "hperf.fullname" .) | quote }}
40+
{{- if .Values.latency.duration }}
41+
- "--duration"
42+
- "{{ .Values.latency.duration }}"
43+
{{- end }}
44+
{{- if .Values.bandwidth.printAll }}
45+
- "--print-all"
46+
{{- end }}
47+
{{- if .Values.bandwidth.micro }}
48+
- "--micro"
49+
{{- end }}
50+
resources:
51+
{{- toYaml .Values.resources | nindent 12 }}
52+
{{- with .Values.nodeSelector }}
53+
nodeSelector:
54+
{{- toYaml . | nindent 8 }}
55+
{{- end }}
56+
{{- with .Values.affinity }}
57+
affinity:
58+
{{- toYaml . | nindent 8 }}
59+
{{- end }}
60+
{{- with .Values.tolerations }}
61+
tolerations:
62+
{{- toYaml . | nindent 8 }}
63+
{{- end }}
64+
restartPolicy: OnFailure
65+
{{- end }}

helm/hperf/templates/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
publishNotReadyAddresses: true
99
clusterIP: None
1010
ports:
11-
- port: 9999
11+
- port: {{ .Values.hperf.port }}
1212
name: http1
1313
selector:
1414
app: hperf

helm/hperf/templates/statefulset.yaml

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ metadata:
55
namespace: {{ .Release.Namespace | quote }}
66
labels:
77
app: hperf
8+
{{- include "hperf.labels" . | nindent 4 }}
89
spec:
910
serviceName: {{ template "hperf.fullname" . }}
1011
replicas: {{ .Values.replicaCount }}
@@ -31,13 +32,23 @@ spec:
3132
{{- toYaml .Values.securityContext | nindent 12 }}
3233
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
3334
imagePullPolicy: {{ .Values.image.pullPolicy }}
35+
env:
36+
- name: POD_IP
37+
valueFrom:
38+
fieldRef:
39+
fieldPath: status.podIP
3440
args:
35-
{{- range $i := until ($.Values.replicaCount | int)}}
36-
- {{ template "hperf.fullname" $ }}-{{ $i }}.{{ template "hperf.fullname" $ }}.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}
37-
{{ end }}
41+
- "server"
42+
- "--address"
43+
- "$(POD_IP):{{ .Values.hperf.port }}"
44+
- "--storage-path"
45+
- "/tmp/hperf/"
3846
ports:
39-
- name: http1
40-
containerPort: 9999
47+
- name: server
48+
containerPort: {{ .Values.hperf.port}}
49+
volumeMounts:
50+
- name: {{ include "hperf.fullname" . }}-volume
51+
mountPath: /tmp/hperf
4152
{{- with .Values.nodeSelector }}
4253
nodeSelector:
4354
{{- toYaml . | nindent 8 }}
@@ -56,3 +67,45 @@ spec:
5667
tolerations:
5768
{{- toYaml . | nindent 8 }}
5869
{{- end }}
70+
71+
volumes:
72+
- name: {{ include "hperf.fullname" . }}-volume
73+
{{- if or (hasKey .Values.hperf.hperfVolume "volumeClaimTemplate") (hasKey .Values.hperf.hperfVolume "emptyDir") (hasKey .Values.hperf.hperfVolume "hostPath" ) }}
74+
{{- if .Values.hperf.hperfVolume.emptyDir }}
75+
emptyDir:
76+
{{- with .Values.hperf.hperfVolume.emptyDir }}
77+
{{- toYaml . | nindent 10 }}
78+
{{- end }}
79+
{{ end }}
80+
{{- if .Values.hperf.hperfVolume.hostPath }}
81+
hostPath:
82+
path: {{ .Values.hperf.hperfVolume.hostPath.path | required "hostPath.path is required when using hostPath volume" }}
83+
type: {{ .Values.hperf.hperfVolume.hostPath.type | default "DirectoryOrCreate" }}
84+
{{- end }}
85+
{{- else }}
86+
emptyDir:
87+
sizeLimit: 100Mi
88+
{{- end }}
89+
{{- if .Values.hperf.hperfVolume.volumeClaimTemplate }}
90+
volumeClaimTemplates:
91+
- metadata:
92+
name: {{ include "hperf.fullname" . }}-volume
93+
{{- with .Values.hperf.hperfVolume.volumeClaimTemplate.storageAnnotations }}
94+
annotations: {{- toYaml . | nindent 12 }}
95+
{{- end }}
96+
spec:
97+
{{- if .Values.hperf.hperfVolume.volumeClaimTemplate.storageClassName }}
98+
storageClassName: {{ .Values.hperf.hperfVolume.volumeClaimTemplate.storageClassName }}
99+
{{- end }}
100+
accessModes:
101+
- ReadWriteOnce
102+
resources:
103+
requests:
104+
storage: {{ .Values.hperf.hperfVolume.volumeClaimTemplate.size }}
105+
{{- end }}
106+
{{- $hasVCT := hasKey .Values.hperf.hperfVolume "volumeClaimTemplate" }}
107+
{{- $hasEmptyDir := hasKey .Values.hperf.hperfVolume "emptyDir" }}
108+
{{- $hasHostPath := hasKey .Values.hperf.hperfVolume "hostPath" }}
109+
{{- if or (and $hasVCT $hasEmptyDir) (and $hasVCT $hasHostPath) (and $hasEmptyDir $hasHostPath) }}
110+
{{- fail "Only one volume type can be specified at the time: volumeClaimTemplate, emptyDir, or hostPath" }}
111+
{{- end }}

helm/hperf/values.yaml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ image:
88
repository: quay.io/minio/hperf
99
pullPolicy: Always
1010
# Overrides the image tag whose default is the chart appVersion.
11-
tag: v4.0.5
11+
tag: v5.0.5
1212

1313
imagePullSecrets: []
1414

@@ -63,3 +63,53 @@ nodeSelector: {}
6363
tolerations: []
6464

6565
affinity: {}
66+
67+
hperf:
68+
labels: {}
69+
# Port to run hperf server listening in 0.0.0.0:{{ port }}
70+
port: 9010
71+
72+
# Type of volume to use. Supported types are emptyDir hostPath and persistentVolumeClaim
73+
# WARNING: Only one volume type can be specified at the time: volumeClaimTemplate, emptyDir, or hostPath
74+
hperfVolume:
75+
emptyDir:
76+
sizeLimit: 1Gi
77+
78+
# HostPath configuration (used when type: hostPath)
79+
# hostPath:
80+
# path: /host/tmp/hperf
81+
# type: DirectoryOrCreate
82+
83+
# When volumeType is persistentVolumeClaim
84+
# volumeClaimTemplate:
85+
# # The capacity for the volume
86+
# size: 100Mi
87+
# #storageClassName: standard
88+
# # Specify `storageAnnotations <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/>`__
89+
# storageAnnotations: {}
90+
91+
# bandwidth will start hperf as a client in a Job to perform a benchmark of throughput
92+
bandwidth:
93+
labels: {}
94+
# set a custom test id, default to chart name
95+
id: bandwidth-test
96+
# duration of the test in seconds
97+
duration: 30
98+
# number of concurrent clients
99+
concurrency: 10
100+
# print all data points
101+
printAll: true
102+
#Display timers in microseconds instead of milliseconds
103+
micro: false
104+
105+
## latency will start hperf as a client in a Job to perform a benchmark of latency
106+
#latency:
107+
# labels: {}
108+
# # set a custom test id, default to chart name
109+
# id: latency-test
110+
# controls how long a test will run in seconds (default: 30)
111+
# duration: 30
112+
# # print all data points
113+
# printAll: true
114+
# #Display timers in microseconds instead of milliseconds
115+
# micro: false

0 commit comments

Comments
 (0)