From 3c01fe5cc145fc2d2bbd1fbb04a05d0c598ff7a7 Mon Sep 17 00:00:00 2001 From: Doug Szumski Date: Mon, 4 Feb 2019 13:32:09 +0000 Subject: [PATCH] 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 --- ansible/group_vars/all/node-exporter | 6 --- ansible/node-exporter.yml | 15 ------- ansible/overcloud-extras.yml | 1 - ansible/roles/node-exporter/README.md | 45 ------------------- ansible/roles/node-exporter/defaults/main.yml | 35 --------------- ansible/roles/node-exporter/tasks/deploy.yml | 14 ------ ansible/roles/node-exporter/tasks/destroy.yml | 29 ------------ ansible/roles/node-exporter/tasks/main.yml | 2 - ansible/roles/node-exporter/tasks/pull.yml | 10 ----- .../roles/node-exporter/tasks/reconfigure.yml | 1 - ansible/roles/node-exporter/tasks/upgrade.yml | 3 -- etc/kayobe/node-exporter.yml | 10 ----- ...rometheus-deployment-75792bba2fc39385.yaml | 4 ++ 13 files changed, 4 insertions(+), 171 deletions(-) delete mode 100644 ansible/group_vars/all/node-exporter delete mode 100644 ansible/node-exporter.yml delete mode 100644 ansible/roles/node-exporter/README.md delete mode 100644 ansible/roles/node-exporter/defaults/main.yml delete mode 100644 ansible/roles/node-exporter/tasks/deploy.yml delete mode 100644 ansible/roles/node-exporter/tasks/destroy.yml delete mode 100644 ansible/roles/node-exporter/tasks/main.yml delete mode 100644 ansible/roles/node-exporter/tasks/pull.yml delete mode 120000 ansible/roles/node-exporter/tasks/reconfigure.yml delete mode 100644 ansible/roles/node-exporter/tasks/upgrade.yml delete mode 100644 etc/kayobe/node-exporter.yml create mode 100644 releasenotes/notes/remove-overcloud-prometheus-deployment-75792bba2fc39385.yaml diff --git a/ansible/group_vars/all/node-exporter b/ansible/group_vars/all/node-exporter deleted file mode 100644 index 9e1c182ae..000000000 --- a/ansible/group_vars/all/node-exporter +++ /dev/null @@ -1,6 +0,0 @@ ---- -############################################################################### -# Prometheus node exporter configuration. - -# Whether Prometheus node exporter is enabled. -nodeexporter_enabled: False diff --git a/ansible/node-exporter.yml b/ansible/node-exporter.yml deleted file mode 100644 index 405d4ed57..000000000 --- a/ansible/node-exporter.yml +++ /dev/null @@ -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 }}" diff --git a/ansible/overcloud-extras.yml b/ansible/overcloud-extras.yml index 4993ce0de..4ac259052 100644 --- a/ansible/overcloud-extras.yml +++ b/ansible/overcloud-extras.yml @@ -10,5 +10,4 @@ - import_playbook: docker-registry.yml - import_playbook: inspection-store.yml - import_playbook: opensm.yml -- import_playbook: node-exporter.yml - import_playbook: cadvisor.yml diff --git a/ansible/roles/node-exporter/README.md b/ansible/roles/node-exporter/README.md deleted file mode 100644 index 008af7b34..000000000 --- a/ansible/roles/node-exporter/README.md +++ /dev/null @@ -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 () diff --git a/ansible/roles/node-exporter/defaults/main.yml b/ansible/roles/node-exporter/defaults/main.yml deleted file mode 100644 index 37d909772..000000000 --- a/ansible/roles/node-exporter/defaults/main.yml +++ /dev/null @@ -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 diff --git a/ansible/roles/node-exporter/tasks/deploy.yml b/ansible/roles/node-exporter/tasks/deploy.yml deleted file mode 100644 index 27bf269c5..000000000 --- a/ansible/roles/node-exporter/tasks/deploy.yml +++ /dev/null @@ -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 }}" diff --git a/ansible/roles/node-exporter/tasks/destroy.yml b/ansible/roles/node-exporter/tasks/destroy.yml deleted file mode 100644 index a51e4f74a..000000000 --- a/ansible/roles/node-exporter/tasks/destroy.yml +++ /dev/null @@ -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] }}" diff --git a/ansible/roles/node-exporter/tasks/main.yml b/ansible/roles/node-exporter/tasks/main.yml deleted file mode 100644 index bb8e0094c..000000000 --- a/ansible/roles/node-exporter/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include_tasks: "{{ nodeexporter_action }}.yml" diff --git a/ansible/roles/node-exporter/tasks/pull.yml b/ansible/roles/node-exporter/tasks/pull.yml deleted file mode 100644 index d9a3b8a55..000000000 --- a/ansible/roles/node-exporter/tasks/pull.yml +++ /dev/null @@ -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' diff --git a/ansible/roles/node-exporter/tasks/reconfigure.yml b/ansible/roles/node-exporter/tasks/reconfigure.yml deleted file mode 120000 index 0412f9220..000000000 --- a/ansible/roles/node-exporter/tasks/reconfigure.yml +++ /dev/null @@ -1 +0,0 @@ -deploy.yml \ No newline at end of file diff --git a/ansible/roles/node-exporter/tasks/upgrade.yml b/ansible/roles/node-exporter/tasks/upgrade.yml deleted file mode 100644 index 99348ae91..000000000 --- a/ansible/roles/node-exporter/tasks/upgrade.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include_tasks: pull.yml -- include_tasks: deploy.yml diff --git a/etc/kayobe/node-exporter.yml b/etc/kayobe/node-exporter.yml deleted file mode 100644 index ea1c6b2da..000000000 --- a/etc/kayobe/node-exporter.yml +++ /dev/null @@ -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 diff --git a/releasenotes/notes/remove-overcloud-prometheus-deployment-75792bba2fc39385.yaml b/releasenotes/notes/remove-overcloud-prometheus-deployment-75792bba2fc39385.yaml new file mode 100644 index 000000000..922db42bc --- /dev/null +++ b/releasenotes/notes/remove-overcloud-prometheus-deployment-75792bba2fc39385.yaml @@ -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.