Skip to content

Commit

Permalink
Able to run the sysbench test on a specific node
Browse files Browse the repository at this point in the history
  • Loading branch information
e-minguez authored and rsevilla87 committed Aug 31, 2021
1 parent e991ac4 commit 24839e5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/samples/sysbench/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ spec:
enabled: true
#kind: vm
# If you want to run this as a VM uncomment the above
#pin_node: "worker-0.mylab.example.com"
tests:
- name: cpu
parameters:
Expand Down
4 changes: 4 additions & 0 deletions docs/sysbench.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ The optional argument **runtime_class** can be set to specify an
optional runtime_class to the podSpec runtimeClassName. This is
primarily intended for Kata containers.

The `pin_node` parameter allows to place the sysbench pod
on a specific node, using the `hostname` label.

Note: please ensure you set 0 for other workloads if editing the
[cr.yaml](../config/samples/sysbench/cr.yaml) file otherwise

Expand All @@ -29,6 +32,7 @@ spec:
enabled: true
#kind: vm
# If you want to run this as a VM uncomment the above
#pin_node: "worker-0.mylab.example.com"
tests:
- name: cpu
parameters:
Expand Down
4 changes: 4 additions & 0 deletions roles/sysbench/templates/workload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ spec:
app: sysbench-{{ trunc_uuid }}
benchmark-uuid: {{ uuid }}
spec:
{% if workload_args.pin_node is defined %}
nodeSelector:
kubernetes.io/hostname: '{{ workload_args.pin_node }}'
{% endif %}
{% if workload_args.runtime_class is defined %}
runtimeClassName: "{{ workload_args.runtime_class }}"
{% endif %}
Expand Down

0 comments on commit 24839e5

Please sign in to comment.