Skip to content
Snippets Groups Projects
Commit e10bda30 authored by Sören Henning's avatar Sören Henning
Browse files

Merge branch 'feature/kubernetesVolume' into 'master'

Use a Kubernetes volume to store results if executed as Kubernetes job

Closes #104

See merge request !57
parents 3f52eec9 68108583
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,27 @@ For executing benchmarks, access to Kubernetes cluster is required. We suggest
to create a dedicated namespace for executing our benchmarks. The following
services need to be available as well.
### Kubernetes Volume
For executing the benchmark as a Kubernetes job it is required to use a volume to store the results of the executions.
In `infrastructure/kubernetes` are two files for creating a volume.
Either one of them should be used.
The `volumeSingle.yaml` is meant for systems where Kubernetes is run locally (e.g. minikube, kind etc.).
However, you can also use the other file.
In `volumeSingle.yaml` you need to set `path` to the path on your machine where the results should be stored.
The `volumeCluster.yaml` should be used when Kubernetes runs in the cloud.
In the `nodeAffinity` section you need to exchange `<node-name>` to the name of the node where the volume should be created (this node will most likely execute also the job).
However, you can also set a different `nodeAffinity`.
Further you need to set `path` to the path on the node where the results should be stored.
After setting the properties you can create the volume with:
```sh
kubectl apply -f iinfrastructure/kubernetes/volume(Single|Cluster).yaml
```
#### Prometheus
We suggest to use the [Prometheus Operator](https://github.com/coreos/prometheus-operator)
......@@ -183,4 +204,3 @@ There are the following benchmarking strategies:
* `check-all`: For each dimension value, execute one lag experiment for all amounts of instances within the current domain.
* `linear-search`: A heuristic which works as follows: For each dimension value, execute one lag experiment for all number of instances within the current domain. The execution order is from the lowest number of instances to the highest amount of instances and the execution for each dimension value is stopped, when a suitable amount of instances is found or if all lag experiments for the dimension value were not successful.
* `binary-search`: A heuristic which works as follows: For each dimension value, execute one lag experiment for all number of instances within the current domain. The execution order is in a binary-search-like manner. The execution is stopped, when a suitable amount of instances is found or if all lag experiments for the dimension value were not successful.
apiVersion: v1
kind: PersistentVolume
metadata:
name: theodolite-pv-volume
spec:
capacity:
storage: 1Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: </your/path/to/results/folder>
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- <node-name>
---
# https://kubernetes.io/docs/concepts/storage/storage-classes/#local
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: theodolite-pv-claim
spec:
storageClassName: local-storage
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
apiVersion: v1
kind: PersistentVolume
metadata:
name: theodolite-pv-volume
labels:
type: local
spec:
storageClassName: theodolite
capacity:
storage: 100m
accessModes:
- ReadWriteOnce
hostPath:
path: </your/path/to/results/folder>
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: theodolite-pv-claim
spec:
storageClassName: theodolite
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100m
......@@ -5,6 +5,10 @@ metadata:
spec:
template:
spec:
volumes:
- name: theodolite-pv-storage
persistentVolumeClaim:
claimName: theodolite-pv-claim
containers:
- name: theodolite
image: bvonheid/theodolite:latest
......@@ -32,8 +36,13 @@ spec:
value: "http://prometheus-operated:9090"
# - name: NAMESPACE
# value: "default"
- name: RESULT_PATH
value: "results"
- name: PYTHONUNBUFFERED
value: "1"
volumeMounts:
- mountPath: "/app/results"
name: theodolite-pv-storage
restartPolicy: Never
backoffLimit: 4
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment