Remove support for deploying cAdvisor

Kolla-Ansible now supports deploying cAdvisor so we
no longer need this.

Change-Id: I9e37651643c18e06f9143893bb3564ec0e9f2ccd
Story: 2004932
Task: 29321
This commit is contained in:
Doug Szumski 2019-02-04 13:45:30 +00:00
parent 3c01fe5cc1
commit 5f94a31b5a
13 changed files with 4 additions and 170 deletions

View File

@ -1,15 +0,0 @@
---
# Deploy/pull/reconfigure/upgrade cAdvisor.
#
# Follows kolla-ansible service deployment patterns.
#
# Variables:
# action: One of deploy, destroy, pull, reconfigure, upgrade
- name: Ensure cAdvisor is deployed
hosts: overcloud:&docker
tags:
- cadvisor
roles:
- role: cadvisor
cadvisor_action: "{{ kayobe_action }}"

View File

@ -1,6 +0,0 @@
---
###############################################################################
# cAdvisor configuration.
# Whether cAdvisor is enabled.
cadvisor_enabled: False

View File

@ -10,4 +10,3 @@
- import_playbook: docker-registry.yml
- import_playbook: inspection-store.yml
- import_playbook: opensm.yml
- import_playbook: cadvisor.yml

View File

@ -1,44 +0,0 @@
cAdvisor
========
This role can be used to configure cAdvisor running in a Docker container.
Requirements
------------
The host executing the role has the following requirements:
* Docker engine
* Python ``docker >= 2.0.0``
Role Variables
--------------
``cadvisor_enabled``: Whether the cAdvisor is enabled. Defaults to ``false``.
``cadvisor_namespace``: Docker image namespace. Defaults to ``cadvisor``.
``cadvisor_image``: Docker image name.
``cadvisor_tag``: Docker image tag. Defaults to ``v0.28.3``.
``cadvisor_image_full``: Full docker image specification.
``cadvisor_restart_policy``: Docker restart policy for cAdvisor container. Defaults
to ``unless-stopped``.
``cadvisor_restart_retries``: Number of Docker restarts. Defaults to 10.
Dependencies
------------
None
Example Playbook
----------------
The following playbook configures cAdvisor.
---
- hosts: cadvisor
roles:
- role: cadvisor
Author Information
------------------
- Jonathan Davies (<jpds@protonmail.com>)

View File

@ -1,35 +0,0 @@
---
# Roughly follows kolla-ansible's service deployment patterns.
# Action to perform. One of 'deploy', 'destroy', 'pull', 'reconfigure',
# 'upgrade'.
cadvisor_action: deploy
# Whether cAdvisor is enabled.
cadvisor_enabled: false
# Service deployment definition.
cadvisor_services:
cadvisor:
container_name: cadvisor
enabled: "{{ cadvisor_enabled }}"
image: "{{ cadvisor_image_full }}"
published_ports: '8080:8080'
read_only: True
volumes:
- "/:/rootfs"
- "/var/run:/var/run:rw"
- "/sys:/sys:ro"
- "/var/lib/docker/:/var/lib/docker:ro"
- "/dev/disk/:/dev/disk:ro"
####################
# Docker
####################
cadvisor_namespace: "cadvisor"
cadvisor_image: "{{ docker_registry ~ '/' if docker_registry | default else '' }}{{ cadvisor_namespace }}/cadvisor"
cadvisor_tag: "v0.28.3"
cadvisor_image_full: "{{ cadvisor_image }}:{{ cadvisor_tag }}"
cadvisor_restart_policy: "unless-stopped"
#cadvisor_restart_retries: 10

View File

@ -1,14 +0,0 @@
---
- name: Ensure cAdvisor container is running
docker_container:
image: "{{ item.value.image }}"
name: "{{ item.value.container_name }}"
network_mode: "host"
privileged: "{{ item.value.privileged | default(omit) }}"
published_ports: "{{ item.value.published_ports | default(omit) }}"
read_only: "{{ item.value.read_only | default(omit) }}"
restart_policy: "{{ cadvisor_restart_policy }}"
restart_retries: "{{ cadvisor_restart_retries | default(omit) }}"
state: "{{ item.value.enabled | ternary('started', 'absent') }}"
volumes: "{{ item.value.volumes }}"
with_dict: "{{ cadvisor_services }}"

View File

@ -1,29 +0,0 @@
---
- name: Ensure cAdvisor container is stopped
docker_container:
name: "{{ item.value.container_name }}"
state: "absent"
with_dict: "{{ cadvisor_services }}"
- name: Check whether cAdvisor volumes are present
command: docker volume inspect {{ volume }}
changed_when: False
with_subelements:
- "{{ cadvisor_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 cAdvisor 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] }}"

View File

@ -1,2 +0,0 @@
---
- include_tasks: "{{ cadvisor_action }}.yml"

View File

@ -1,10 +0,0 @@
---
- name: Pulling cAdvisor container image
docker_image:
name: "{{ item.value.image }}"
repository: "{{ item.value.image }}"
state: present
with_dict: "{{ cadvisor_services }}"
when:
- item.value.enabled
- cadvisor_action != 'destroy'

View File

@ -1 +0,0 @@
deploy.yml

View File

@ -1,3 +0,0 @@
---
- include_tasks: pull.yml
- include_tasks: deploy.yml

View File

@ -1,10 +0,0 @@
---
###############################################################################
# cAdvisor configuration.
# Whether cAdvisor is enabled.
#cadvisor_enabled:
###############################################################################
# Dummy variable to allow Ansible to accept this file.
workaround_ansible_issue_8743: yes

View File

@ -0,0 +1,4 @@
---
deprecations:
- First class support in Kayobe for deploying cAdvisor
has been removed since this is now supported via Kolla-Ansible.