Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add client gc_max_allocs param #169

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,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 @@ -30,13 +30,13 @@
nomad_debug: false

## Asserts
nomad_skip_ensure_all_hosts: "{{ lookup('env','NOMAD_SKIP_ENSURE_ALL_HOSTS') | default('false', true) }}"

Check warning on line 33 in defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ lookup('env','NOMAD_SKIP_ENSURE_ALL_HOSTS') | default('false', true) }} -> {{ lookup('env', 'NOMAD_SKIP_ENSURE_ALL_HOSTS') | default('false', true) }}

## Config Purge
nomad_allow_purge_config: "{{ lookup('env','NOMAD_ALLOW_PURGE_CONFIG') | default('false', true) }}"

Check warning on line 36 in defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ lookup('env','NOMAD_ALLOW_PURGE_CONFIG') | default('false', true) }} -> {{ lookup('env', 'NOMAD_ALLOW_PURGE_CONFIG') | default('false', true) }}

### Package
nomad_version: "{{ lookup('env','NOMAD_VERSION') | default('1.1.1', true) }}"

Check warning on line 39 in defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ lookup('env','NOMAD_VERSION') | default('1.1.1', true) }} -> {{ lookup('env', 'NOMAD_VERSION') | default('1.1.1', true) }}
nomad_architecture_map:
amd64: amd64
x86_64: amd64
Expand All @@ -45,12 +45,12 @@
32-bit: "386"
64-bit: amd64
nomad_architecture: "{{ nomad_architecture_map[ansible_architecture] }}"
nomad_pkg: "nomad_{{ nomad_version }}_linux_{{nomad_architecture}}.zip"

Check warning on line 48 in defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: nomad_{{ nomad_version }}_linux_{{nomad_architecture}}.zip -> nomad_{{ nomad_version }}_linux_{{ nomad_architecture }}.zip
nomad_zip_url: "https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version }}_linux_{{nomad_architecture}}.zip"

Check warning on line 49 in defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version }}_linux_{{nomad_architecture}}.zip -> https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version }}_linux_{{ nomad_architecture }}.zip
nomad_checksum_file_url: "https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version}}_SHA256SUMS"

Check warning on line 50 in defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version}}_SHA256SUMS -> https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version }}_SHA256SUMS
nomad_podman_enable: false
nomad_podman_version: "{{ lookup('env','NOMAD_PODMAN_VERSION') | default('0.3.0', true) }}"

Check warning on line 52 in defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ lookup('env','NOMAD_PODMAN_VERSION') | default('0.3.0', true) }} -> {{ lookup('env', 'NOMAD_PODMAN_VERSION') | default('0.3.0', true) }}
nomad_podman_pkg: "nomad-driver-podman_{{ nomad_podman_version }}_linux_{{nomad_architecture}}.zip"

Check warning on line 53 in defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: nomad-driver-podman_{{ nomad_podman_version }}_linux_{{nomad_architecture}}.zip -> nomad-driver-podman_{{ nomad_podman_version }}_linux_{{ nomad_architecture }}.zip
nomad_podman_url: "https://releases.hashicorp.com/nomad-driver-podman/{{ nomad_podman_version }}"
nomad_podman_zip_url: "{{ nomad_podman_url }}/{{ nomad_podman_pkg }}"
nomad_podman_checksum_file_url: "{{ nomad_podman_url }}/nomad-driver-podman_{{ nomad_podman_version }}_SHA256SUMS"
Expand Down Expand Up @@ -78,9 +78,9 @@
nomad_region: "global"
nomad_log_level: "INFO"
nomad_syslog_enable: true
nomad_iface: "{{ lookup('env','NOMAD_IFACE') | default(ansible_default_ipv4.interface, true) }}"

Check warning on line 81 in defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ lookup('env','NOMAD_IFACE') | default(ansible_default_ipv4.interface, true) }} -> {{ lookup('env', 'NOMAD_IFACE') | default(ansible_default_ipv4.interface, true) }}
nomad_node_name: "{{ inventory_hostname_short }}"
nomad_node_role: "{{ lookup('env','NOMAD_NODE_ROLE') | default('client', true) }}"

Check warning on line 83 in defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ lookup('env','NOMAD_NODE_ROLE') | default('client', true) }} -> {{ lookup('env', 'NOMAD_NODE_ROLE') | default('client', true) }}
nomad_leave_on_terminate: true
nomad_leave_on_interrupt: false
nomad_disable_update_check: false
Expand Down Expand Up @@ -109,6 +109,7 @@
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
1 change: 1 addition & 0 deletions templates/client.hcl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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
Loading