]> git-server-git.apps.pok.os.sepia.ceph.com Git - cephmetrics.git/commitdiff
Merge pull request #173 from zmc/wip-cpu-quota
authorZack Cerza <zack@cerza.org>
Mon, 14 May 2018 18:36:59 +0000 (12:36 -0600)
committerGitHub <noreply@github.com>
Mon, 14 May 2018 18:36:59 +0000 (12:36 -0600)
ansible: Set CPU/RAM quotas on containers

1  2 
ansible/roles/ceph-prometheus/tasks/setup_container.yml

index 0991acc32cd784efd1896bc8091b96cfb675238b,e415abe3730f492b4f2da971ae0260af4060f24f..9058c7835905b8ecd0549074b40fb5cd25dfa55a
      user: "{{ prometheus.user_id }}"
      keep_volumes: true
      pull: true
+     cpu_period: "{{ prometheus.container_cpu_period }}"
+     # As of ansible-2.5.2, this module doesn't support the equivalent of the
+     # --cpus flag, so we must use period/quota for now
+     cpu_quota: "{{ prometheus.container_cpu_period * prometheus.container_cpu_cores }}"
+     #memory: 0
+     #memory_swap: 0
+     memory: "{{ prometheus.container_memory }}GB"
+     memory_swap: "{{ prometheus.container_memory * 2 }}GB"
    notify: Service handler
 +
 +- name: Ship systemd service
 +  copy:
 +    src: prometheus.service
 +    dest: "/etc/systemd/system/"
 +    owner: root
 +    group: root
 +    mode: 0644
 +  notify: Service handler