Skip to content

Commit

Permalink
Merge branch 'master' into leo/client_template_config
Browse files Browse the repository at this point in the history
  • Loading branch information
fairglen authored Oct 31, 2023
2 parents 9aeb815 + 2e22134 commit 0d26282
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ The role defines most of its variables in `defaults/main.yml`:
- Nomad node class
- Default value: **""**

### `nomad_node_pool`

- Used for restricting which client nodes are eligible to receive which workloads.
By default, tasks are opted-out of non-default node pools. This means job authors don’t have to repeatedly add the same constraints to every job just to avoid certain nodes.
- Default value: **""**

### `nomad_no_host_uuid`

- Force the UUID generated by the client to be randomly generated
Expand Down Expand Up @@ -277,6 +283,11 @@ The role defines most of its variables in `defaults/main.yml`:
- Client garbage collection interval
- Default value: **1m**

### `nomad_gc_max_allocs`

- Maximum number of allocations which a client will track before triggering a garbage collection
- Default value: **50**

### `nomad_gc_disk_usage_threshold`

- Disk usage threshold percentage for garbage collection
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ nomad_max_kill_timeout: "30s"
nomad_network_speed: 0
nomad_cpu_total_compute: 0
nomad_gc_interval: "1m"
nomad_gc_max_allocs: 50
nomad_gc_disk_usage_threshold: 80
nomad_gc_inode_usage_threshold: 70
nomad_gc_parallel_destroys: 2
Expand Down
5 changes: 5 additions & 0 deletions templates/client.hcl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ client {
node_class = "{{ nomad_node_class }}"
no_host_uuid = {{ nomad_no_host_uuid | bool | lower }}

{% if nomad_node_pool is defined and nomad_node_pool|length %}
node_pool = "{{ nomad_node_pool }}"
{% endif %}

{% if nomad_use_consul == False %}
servers = [
{%- set comma = joiner(",") -%}
Expand All @@ -21,6 +25,7 @@ client {
cpu_total_compute = {{ nomad_cpu_total_compute }}

gc_interval = "{{ nomad_gc_interval }}"
gc_max_allocs = "{{ nomad_gc_max_allocs }}"
gc_disk_usage_threshold = {{ nomad_gc_disk_usage_threshold }}
gc_inode_usage_threshold = {{ nomad_gc_inode_usage_threshold }}
gc_parallel_destroys = {{ nomad_gc_parallel_destroys }}
Expand Down

0 comments on commit 0d26282

Please sign in to comment.