Skip to content

Commit

Permalink
Add a nodeSelector for vegeta pods
Browse files Browse the repository at this point in the history
  • Loading branch information
e-minguez authored and rsevilla87 committed Sep 2, 2021
1 parent abc48ea commit befbd51
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/samples/vegeta/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ spec:
workload:
name: vegeta
args:
# node_selector: "vegeta=true"
hostnetwork: false
clients: 2
targets:
Expand Down
4 changes: 4 additions & 0 deletions docs/vegeta.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ The option **runtime_class** can be set to specify an optional
runtime_class to the podSpec runtimeClassName. This is primarily
intended for Kata containers.

The **node_selector** option can be used to limit the nodes where
the vegeta pods are deployed.

```yaml
apiVersion: ripsaw.cloudbulldozer.io/v1alpha1
kind: Benchmark
Expand All @@ -24,6 +27,7 @@ spec:
workload:
name: vegeta
args:
# node_selector: "vegeta=true"
clients: 2
image: quay.io/cloud-bulldozer/vegeta:latest
hostnetwork: false
Expand Down
4 changes: 4 additions & 0 deletions roles/vegeta/templates/vegeta.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ spec:
app: vegeta-benchmark-{{ trunc_uuid }}
benchmark-uuid: {{ uuid }}
spec:
{% if workload_args.node_selector is defined %}
nodeSelector:
'{{ workload_args.node_selector.split("=")[0] }}': '{{ workload_args.node_selector.split("=")[1] }}'
{% endif %}
{% if workload_args.runtime_class is defined %}
runtimeClassName: "{{ workload_args.runtime_class }}"
{% endif %}
Expand Down

0 comments on commit befbd51

Please sign in to comment.