-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add fio-standalone Helm chart #1
Open
nikkelma
wants to merge
4
commits into
longhorn:main
Choose a base branch
from
nikkelma:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
217bef5
Add gitignore for common IDE files
nikkelma 049e639
Add fio-standalone Helm chart v0.1.0
nikkelma ff549fe
Rename repository in Helm templates, update defaults
nikkelma 952e769
Rename Helm chart, calculate PVC size from benchmark size
nikkelma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,10 @@ | ||
.DS_Store | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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 |
---|---|---|
|
@@ -123,7 +123,54 @@ Note: a single benchmark for FIO will take about 6 minutes to finish. | |
|
||
See [./deploy/fio.yaml](https://github.com/yasker/kbench/blob/main/deploy/fio.yaml) for available options. | ||
|
||
#### Deploy Comparison Benchmark in Kubernetes cluster | ||
### Deploy Single Volume Benchmark via Helm | ||
|
||
All defaults are the same as in the YAML installation method. | ||
Use the following steps to prep for installation: | ||
```bash | ||
# add helm repo | ||
helm repo add yasker-kbench https://raw.githubusercontent.com/yasker/kbench/main/helm | ||
|
||
# create namespace for needed resources | ||
kubectl create ns fio-benchmarks | ||
``` | ||
|
||
To deploy with all defaults: | ||
```bash | ||
helm upgrade --install fio-benchmark-default \ | ||
yasker-kbench/fio-standalone \ | ||
-n fio-benchmarks \ | ||
--version v0.1.0 | ||
``` | ||
|
||
To customize the installation, create a values.yaml or use `--set` flags: | ||
```bash | ||
# --set flags | ||
helm upgrade --install fio-benchmark-a \ | ||
yasker-kbench/fio-standalone \ | ||
-n fio-benchmarks \ | ||
--version v0.1.0 \ | ||
--set pvc.size=11Gi \ | ||
--set benchmark.size=10G | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we automatically set PVC size to benchmark size * 1.1? Not sure if the chart can do that though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call, will update templates and values |
||
|
||
# values file | ||
cat <<EOF > fio-benchmark-b-values.yaml | ||
pvc: | ||
storageClassName: "local-path" | ||
size: "22Gi" | ||
volumeMode: "Block" | ||
benchmark: | ||
size: "20G" | ||
EOF | ||
|
||
helm upgrade --install fio-benchmark-b \ | ||
yasker-kbench/fio-standalone \ | ||
-n fio-benchmarks \ | ||
--version v0.1.0 \ | ||
-f ./fio-benchmark-b-values.yaml | ||
``` | ||
|
||
### Deploy Comparison Benchmark in Kubernetes cluster | ||
|
||
1. Get a local copy of `fio-cmp.yaml` | ||
``` | ||
|
Binary file not shown.
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 @@ | ||
# 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 | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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,6 @@ | ||
apiVersion: v2 | ||
name: fio | ||
description: Benchmark Kubernetes StorageClass performance with FIO. | ||
type: application | ||
version: 0.1.0 | ||
appVersion: v0.1.0 |
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,11 @@ | ||
{{ if .Values.pvc.storageClassName -}} | ||
Benchmark against StorageClass {{ .Values.pvc.storageClassName | quote }} is running! | ||
{{- else -}} | ||
Benchmark against default StorageClass is running! | ||
{{- end }} | ||
|
||
Check the status of the Job to see when the benchmark is complete: | ||
kubectl get jobs -n {{ .Release.Namespace }} | ||
|
||
View logs of the completed benchmark: | ||
kubectl logs -n {{ .Release.Namespace }} job/{{ include "fio.fullname" . }} |
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,80 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "fio.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 "fio.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 "fio.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "fio.labels" -}} | ||
helm.sh/chart: {{ include "fio.chart" . }} | ||
{{ include "fio.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "fio.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "fio.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "fio.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "fio.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Pre-calculate PVC size from benchmark size | ||
*/}} | ||
{{- define "fio.pvcSize" -}} | ||
{{- if not (kindIs "string" .Values.benchmark.size) }} | ||
{{- fail "Benchmark size must be of format <size>G, e.g. 10G, 25G, 1000G" -}} | ||
{{- end }} | ||
{{- if not (hasSuffix "G" .Values.benchmark.size) -}} | ||
{{- fail "Benchmark size must be of format <size>G, e.g. 10G, 25G, 1000G" -}} | ||
{{- end}} | ||
{{- $sizeElevenX := mul (trimSuffix "G" .Values.benchmark.size) 11 -}} | ||
{{- if (ne (mod $sizeElevenX 10) 0) -}} | ||
{{- add1 (div $sizeElevenX 10) }}Gi | ||
{{- else -}} | ||
{{- div $sizeElevenX 10 }}Gi | ||
{{- end }} | ||
{{- end }} |
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,33 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ include "fio.fullname" . }} | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
benchmark: fio | ||
spec: | ||
containers: | ||
- name: benchmark | ||
image: {{ .Values.benchmark.image.repository }}:{{ .Values.benchmark.image.tag }} | ||
imagePullPolicy: {{ .Values.benchmark.image.pullPolicy }} | ||
env: | ||
{{- if .Values.benchmark.quickMode }} | ||
- name: QUICK_MODE # for debugging | ||
value: "1" | ||
{{- end }} | ||
- name: FILE_NAME | ||
value: "/volume/test" | ||
- name: SIZE | ||
value: {{ .Values.benchmark.size | quote }} | ||
volumeMounts: | ||
- name: vol | ||
mountPath: /volume/ | ||
imagePullSecrets: {{ .Values.benchmark.imagePullSecrets }} | ||
restartPolicy: Never | ||
volumes: | ||
- name: vol | ||
persistentVolumeClaim: | ||
claimName: {{ include "fio.fullname" . }} | ||
backoffLimit: 0 |
14 changes: 14 additions & 0 deletions
14
helm/charts/fio/0.1.0/templates/persistent-volume-claim.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,14 @@ | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ include "fio.fullname" . }} | ||
spec: | ||
volumeMode: {{ .Values.pvc.volumeMode | quote }} | ||
{{- if .Values.pvc.storageClassName }} | ||
storageClassName: {{ .Values.pvc.storageClassName | quote }} | ||
{{- end }} | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: {{ include "fio.pvcSize" . | quote }} |
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,20 @@ | ||
pvc: | ||
# specify storage class to test; | ||
# "" will use the default StorageClass for the cluster | ||
storageClassName: "" | ||
# mode for PVC - "Filesystem" or "Block" | ||
volumeMode: "Filesystem" | ||
|
||
benchmark: | ||
# size of benchmark | ||
# NOTE required format: 10G, 30G, 40G, etc. | ||
size: "30G" | ||
image: | ||
repository: "yasker/kbench" | ||
pullPolicy: "IfNotPresent" | ||
tag: "v0.1.0" | ||
imagePullSecrets: [] | ||
quickMode: false | ||
|
||
nameOverride: "" | ||
fullnameOverride: "" |
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,14 @@ | ||
apiVersion: v1 | ||
entries: | ||
fio: | ||
- apiVersion: v2 | ||
appVersion: v0.1.0 | ||
created: "2021-08-03T16:41:16.873451-04:00" | ||
description: Benchmark Kubernetes StorageClass performance with FIO. | ||
digest: 0c788837ccac5e80388a694bb51af34cecf5faa1e830d0c54fc2c02f78830212 | ||
name: fio | ||
type: application | ||
urls: | ||
- assets/fio-0.1.0.tgz | ||
version: 0.1.0 | ||
generated: "2021-08-03T16:41:16.872569-04:00" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I should release a v0.1.0.