Update to 2022-08-02 11:00

This commit is contained in:
Daniel Berteaud 2022-08-02 11:00:18 +02:00
parent a940a671f5
commit f0969ea815
2 changed files with 44 additions and 0 deletions

View File

@ -38,6 +38,30 @@ nomad_base_conf:
# read_only: False
host_volumes: []
# An arbitrary string which can be used for job placement
# node_class: prod
# Resource reservation for the host to work properly
reserved:
# Unit is MHz
cpu: 200
# can be expressed as number, in which case it'll be the amount of RAM to reserve in MB
# or as a percentage, in which case it'll be a percentage of the total RAM
memory: 15%
# When memory is expressed as a percentage, you can set a minimum amount (in MB) which will be set
# if the percentage is less than that
memory_min: 500
# Unit is MB
disk: 500
# List of reserved ports which won't be allocated on tasks
reserved_ports: []
# Custom metadata to add in Nomad's conf
# meta:
# rack: 12-1
# cni: macvlan,ipvlan
meta: {}
# Server related settings
server:
# Should server be enabled
@ -59,6 +83,7 @@ nomad_base_conf:
# Consul and vault optional URL. This is just to add a shortcut in Nomad's UI
# consul_ui: https://consul.example.org
# vault_ui: https://vault.example.org
# You can override part of the default config without rewriting everything else
# the dict will get merged
nomad_extra_conf: {}

View File

@ -56,6 +56,24 @@ client {
{% endif %}
}
{% endfor %}
reserved {
cpu = {{ nomad_conf.client.reserved.cpu }}
memory = {{ (nomad_conf.client.reserved.memory is search('%$')) | ternary([((nomad_conf.client.reserved.memory | regex_replace('%$', '') | int) * ansible_memtotal_mb * 0.01), nomad_conf.client.reserved.memory_min] | max | int, nomad_conf.client.reserved.memory) }}
disk = {{ nomad_conf.client.reserved.disk }}
reserved_ports = "{{ nomad_conf.client.reserved.reserved_ports | join(',') }}"
}
meta {
{% for meta in nomad_conf.client.meta.keys() | list %}
{{ meta }} = "{{ nomad_conf.client.meta[meta] }}"
{% endfor %}
}
{% if nomad_conf.client.node_class is defined %}
node_class = "{{ nomad_conf.client.node_class }}"
{% endif %}
}
ui {
@ -71,3 +89,4 @@ ui {
}
{% endif %}
}