Skip to content

Commit

Permalink
Add fio-standalone Helm chart v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkelma committed Jul 23, 2021
1 parent cfa943e commit 1a9f82c
Show file tree
Hide file tree
Showing 10 changed files with 227 additions and 0 deletions.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,53 @@ Note: a single benchmark for FIO will take about 6 minutes to finish.

See [./deploy/fio.yaml](https://github.com/yasker/benchmark/blob/main/deploy/fio.yaml) for available options.

### 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-benchmark https://raw.githubusercontent.com/yasker/benchmark/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-benchmark/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-benchmark/fio-standalone \
-n fio-benchmarks \
--version v0.1.0 \
--set pvc.size=11Gi \
--set benchmark.size=10G

# 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-benchmark/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`
Expand Down
Binary file added helm/assets/fio-standalone-0.1.0.tgz
Binary file not shown.
23 changes: 23 additions & 0 deletions helm/charts/fio-standalone/0.1.0/.helmignore
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/
5 changes: 5 additions & 0 deletions helm/charts/fio-standalone/0.1.0/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
name: fio-standalone
description: Benchmark a single Kubernetes StorageClass
type: application
version: 0.1.0
7 changes: 7 additions & 0 deletions helm/charts/fio-standalone/0.1.0/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Benchmark against StorageClass {{ .Values.pvc.storageClassName }} is running!

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-standalone.fullname" . }}
62 changes: 62 additions & 0 deletions helm/charts/fio-standalone/0.1.0/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "fio-standalone.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-standalone.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-standalone.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "fio-standalone.labels" -}}
helm.sh/chart: {{ include "fio-standalone.chart" . }}
{{ include "fio-standalone.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "fio-standalone.selectorLabels" -}}
app.kubernetes.io/name: {{ include "fio-standalone.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "fio-standalone.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "fio-standalone.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
33 changes: 33 additions & 0 deletions helm/charts/fio-standalone/0.1.0/templates/job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "fio-standalone.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: "2G" # must be smaller or match the PVC size
volumeMounts:
- name: vol
mountPath: /volume/
imagePullSecrets: {{ .Values.benchmark.imagePullSecrets }}
restartPolicy: Never
volumes:
- name: vol
persistentVolumeClaim:
claimName: {{ include "fio-standalone.fullname" . }}
backoffLimit: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "fio-standalone.fullname" . }}
spec:
volumeMode: {{ .Values.pvc.volumeMode | quote }}
{{- if .Values.pvc.storageClassName }}
storageClassName: {{ .Values.pvc.storageClassName | quote }}
{{- end }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.pvc.size | quote }}
23 changes: 23 additions & 0 deletions helm/charts/fio-standalone/0.1.0/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
pvc:
# specify storage class to test;
# "" will use the default StorageClass for the cluster
storageClassName: ""
# size of PVC; must be larger than benchmark.size
# NOTE the format: 3Gi, 5Gi, etc.
size: "3Gi"
# mode for PVC - "Filesystem" or "Block"
volumeMode: "Filesystem"

benchmark:
# size of benchmark tests; must be smaller than pvc.size
# NOTE the format: 2G, 4G, etc.
size: "2G"
image:
repository: "yasker/benchmark"
pullPolicy: "IfNotPresent"
tag: "latest"
imagePullSecrets: []
quickMode: false

nameOverride: ""
fullnameOverride: ""
13 changes: 13 additions & 0 deletions helm/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
entries:
fio-standalone:
- apiVersion: v2
created: "2021-07-23T02:12:49.792704-04:00"
description: Benchmark a single Kubernetes StorageClass
digest: f847c4e45bb4187810313a48e0ed4884eb1130c65cda9c165725ddedd25673fc
name: fio-standalone
type: application
urls:
- assets/fio-standalone-0.1.0.tgz
version: 0.1.0
generated: "2021-07-23T02:12:49.791916-04:00"

0 comments on commit 1a9f82c

Please sign in to comment.