feat: add node affinity/anti-affinity and storage class knobs to run this on a cluster

This commit is contained in:
gmega 2025-01-15 11:52:32 -03:00
parent 47646eb02a
commit 60fd274b18
No known key found for this signature in database
GPG Key ID: 6290D34EAD824B18
5 changed files with 43 additions and 2 deletions

View File

@ -11,4 +11,7 @@ spec:
- ReadWriteMany
resources:
requests:
storage: {{ include "storage.size" . }}
storage: {{ include "storage.size" . }}
{{- if .Values.deployment.storageClass }}
storageClassName: {{ .Values.deployment.storageClass }}
{{- end }}

View File

@ -20,6 +20,22 @@ spec:
{{- include "deluge-benchmarks.labels" . | nindent 8 }}
spec:
{{- if not .Values.experiment.allowColocation }}
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/component
operator: In
values:
- deluge-node
topologyKey: "kubernetes.io/hostname"
{{- end }}
{{- with .Values.deployment.delugeNodePool }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: deluge-node
image: codexstorage/deluge

View File

@ -15,6 +15,10 @@ spec:
{{- include "deluge-benchmarks.labels" . | nindent 8 }}
spec:
{{- with .Values.deployment.runnerNodePool }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: deluge-experiment-runner
image: codexstorage/bittorrent-benchmarks:latest

View File

@ -21,6 +21,10 @@ spec:
{{- include "deluge-benchmarks.labels" . | nindent 8 }}
spec:
{{- with .Values.deployment.trackerNodePool }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: bittorrent-tracker
image: codexstorage/bittorrent-tracker

View File

@ -15,4 +15,18 @@ experiment:
deployment:
pvcName: ""
appName: ""
appName: ""
# If false, Deluge nodes will not be allowed to run on the same node.
allowColocation: true
# Labels for setting Deluge, tracker, and experiment runner node affinity towards pools.
# Example:
# delugeNodePool:
# workload: benchmarks
delugeNodePool: {}
trackerNodePool: {}
runnerNodePool: {}
# Storage class for persistent volume claims.
storageClass: ""