Remove support for deploying Prometheus node-exporter
Kolla-Ansible now supports deploying Prometheus so we no longer need this. Story: 2004932 Task: 29320 Change-Id: I9242cf1ec7c19b135d7d7bdb9b803718b719ec58
This commit is contained in:
parent
7cb684a253
commit
3c01fe5cc1
@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
###############################################################################
|
|
||||||
# Prometheus node exporter configuration.
|
|
||||||
|
|
||||||
# Whether Prometheus node exporter is enabled.
|
|
||||||
nodeexporter_enabled: False
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
# Deploy/pull/reconfigure/upgrade the Prometheus Node Exporter.
|
|
||||||
#
|
|
||||||
# Follows kolla-ansible service deployment patterns.
|
|
||||||
#
|
|
||||||
# Variables:
|
|
||||||
# action: One of deploy, destroy, pull, reconfigure, upgrade
|
|
||||||
|
|
||||||
- name: Ensure Node Exporter is deployed
|
|
||||||
hosts: overcloud:&docker
|
|
||||||
tags:
|
|
||||||
- node-exporter
|
|
||||||
roles:
|
|
||||||
- role: node-exporter
|
|
||||||
nodeexporter_action: "{{ kayobe_action }}"
|
|
@ -10,5 +10,4 @@
|
|||||||
- import_playbook: docker-registry.yml
|
- import_playbook: docker-registry.yml
|
||||||
- import_playbook: inspection-store.yml
|
- import_playbook: inspection-store.yml
|
||||||
- import_playbook: opensm.yml
|
- import_playbook: opensm.yml
|
||||||
- import_playbook: node-exporter.yml
|
|
||||||
- import_playbook: cadvisor.yml
|
- import_playbook: cadvisor.yml
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
Prometheus Node Exporter
|
|
||||||
========================
|
|
||||||
|
|
||||||
This role can be used to configure a Prometheus node exporter running
|
|
||||||
in a Docker container.
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
------------
|
|
||||||
|
|
||||||
The host executing the role has the following requirements:
|
|
||||||
|
|
||||||
* Docker engine
|
|
||||||
* Python ``docker >= 2.0.0``
|
|
||||||
|
|
||||||
Role Variables
|
|
||||||
--------------
|
|
||||||
|
|
||||||
``nodeexporter_enabled``: Whether the Node Exporter is enabled. Defaults to ``true``.
|
|
||||||
``nodeexporter_namespace``: Docker image namespace. Defaults to ``prom``.
|
|
||||||
``nodeexporter_image``: Docker image name.
|
|
||||||
``nodeexporter_tag``: Docker image tag. Defaults to ``latest``.
|
|
||||||
``nodeexporter_image_full``: Full docker image specification.
|
|
||||||
``nodeexporter_restart_policy``: Docker restart policy for Node Exporter container. Defaults
|
|
||||||
to ``unless-stopped``.
|
|
||||||
``nodeexporter_restart_retries``: Number of Docker restarts. Defaults to 10.
|
|
||||||
|
|
||||||
Dependencies
|
|
||||||
------------
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
Example Playbook
|
|
||||||
----------------
|
|
||||||
|
|
||||||
The following playbook configures Node Exporter.
|
|
||||||
|
|
||||||
---
|
|
||||||
- hosts: node-exporter
|
|
||||||
roles:
|
|
||||||
- role: node-exporter
|
|
||||||
|
|
||||||
Author Information
|
|
||||||
------------------
|
|
||||||
|
|
||||||
- Jonathan Davies (<jpds@protonmail.com>)
|
|
@ -1,35 +0,0 @@
|
|||||||
---
|
|
||||||
# Roughly follows kolla-ansible's service deployment patterns.
|
|
||||||
|
|
||||||
# Action to perform. One of 'deploy', 'destroy', 'pull', 'reconfigure',
|
|
||||||
# 'upgrade'.
|
|
||||||
nodeexporter_action: deploy
|
|
||||||
|
|
||||||
# Whether Node Exporter is enabled.
|
|
||||||
nodeexporter_enabled: false
|
|
||||||
|
|
||||||
# Service deployment definition.
|
|
||||||
nodeexporter_services:
|
|
||||||
nodeexporter:
|
|
||||||
container_name: nodeexporter
|
|
||||||
enabled: "{{ nodeexporter_enabled }}"
|
|
||||||
image: "{{ nodeexporter_image_full }}"
|
|
||||||
command: --path.procfs=/host/proc --path.sysfs=/host/sys --collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)" --collector.ntp
|
|
||||||
privileged: True
|
|
||||||
read_only: True
|
|
||||||
volumes:
|
|
||||||
- "/proc:/host/proc"
|
|
||||||
- "/sys:/host/sys"
|
|
||||||
- "/:/rootfs"
|
|
||||||
- "/etc/hostname:/etc/host_hostname"
|
|
||||||
|
|
||||||
####################
|
|
||||||
# Docker
|
|
||||||
####################
|
|
||||||
nodeexporter_namespace: "prom"
|
|
||||||
nodeexporter_image: "{{ docker_registry ~ '/' if docker_registry | default else '' }}{{ nodeexporter_namespace }}/node-exporter"
|
|
||||||
nodeexporter_tag: "v0.15.0"
|
|
||||||
nodeexporter_image_full: "{{ nodeexporter_image }}:{{ nodeexporter_tag }}"
|
|
||||||
|
|
||||||
nodeexporter_restart_policy: "unless-stopped"
|
|
||||||
#nodeexporter_restart_retries: 10
|
|
@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Ensure node exporter container is running
|
|
||||||
docker_container:
|
|
||||||
image: "{{ item.value.image }}"
|
|
||||||
name: "{{ item.value.container_name }}"
|
|
||||||
command: "{{ item.value.command }}"
|
|
||||||
network_mode: "host"
|
|
||||||
privileged: "{{ item.value.privileged | default(omit) }}"
|
|
||||||
read_only: "{{ item.value.read_only | default(omit) }}"
|
|
||||||
restart_policy: "{{ nodeexporter_restart_policy }}"
|
|
||||||
restart_retries: "{{ nodeexporter_restart_retries | default(omit) }}"
|
|
||||||
state: "{{ item.value.enabled | ternary('started', 'absent') }}"
|
|
||||||
volumes: "{{ item.value.volumes }}"
|
|
||||||
with_dict: "{{ nodeexporter_services }}"
|
|
@ -1,29 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Ensure node exporter container is stopped
|
|
||||||
docker_container:
|
|
||||||
name: "{{ item.value.container_name }}"
|
|
||||||
state: "absent"
|
|
||||||
with_dict: "{{ nodeexporter_services }}"
|
|
||||||
|
|
||||||
- name: Check whether Node Exporter volumes are present
|
|
||||||
command: docker volume inspect {{ volume }}
|
|
||||||
changed_when: False
|
|
||||||
with_subelements:
|
|
||||||
- "{{ nodeexporter_services }}"
|
|
||||||
- volumes
|
|
||||||
when: "'/' not in volume"
|
|
||||||
failed_when:
|
|
||||||
- volume_result.rc != 0
|
|
||||||
- "'No such volume' not in volume_result.stderr"
|
|
||||||
vars:
|
|
||||||
volume: "{{ item.1.split(':')[0] }}"
|
|
||||||
register: volume_result
|
|
||||||
|
|
||||||
- name: Ensure Node Exporter volumes are absent
|
|
||||||
command: docker volume rm {{ volume }}
|
|
||||||
with_items: "{{ volume_result.results }}"
|
|
||||||
when:
|
|
||||||
- not item | skipped
|
|
||||||
- item.rc == 0
|
|
||||||
vars:
|
|
||||||
volume: "{{ item.item.1.split(':')[0] }}"
|
|
@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
- include_tasks: "{{ nodeexporter_action }}.yml"
|
|
@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Pulling Node Exporter container image
|
|
||||||
docker_image:
|
|
||||||
name: "{{ item.value.image }}"
|
|
||||||
repository: "{{ item.value.image }}"
|
|
||||||
state: present
|
|
||||||
with_dict: "{{ nodeexporter_services }}"
|
|
||||||
when:
|
|
||||||
- item.value.enabled
|
|
||||||
- nodeexporter_action != 'destroy'
|
|
@ -1 +0,0 @@
|
|||||||
deploy.yml
|
|
@ -1,3 +0,0 @@
|
|||||||
---
|
|
||||||
- include_tasks: pull.yml
|
|
||||||
- include_tasks: deploy.yml
|
|
@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
###############################################################################
|
|
||||||
# Prometheus node exporter configuration.
|
|
||||||
|
|
||||||
# Whether Prometheus node exporter is enabled.
|
|
||||||
#nodeexporter_enabled:
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# Dummy variable to allow Ansible to accept this file.
|
|
||||||
workaround_ansible_issue_8743: yes
|
|
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
deprecations:
|
||||||
|
- First class support in Kayobe for deploying Prometheus Node exporter
|
||||||
|
has been removed since this is now supported via Kolla-Ansible.
|
Loading…
Reference in New Issue
Block a user