Use Docker healthchecks for qdrouterd services

This change enables the use of Docker healthchecks for qdrouterd services.
Implements: blueprint container-health-check

Change-Id: If689be90690251180972454ed0baee658cc5e895
This commit is contained in:
LinPeiWen 2021-03-12 01:07:39 +00:00
parent cef8c8b3de
commit d3e91045f5
4 changed files with 23 additions and 0 deletions

View File

@ -9,6 +9,8 @@ qdrouterd_services:
image: "{{ qdrouterd_image_full }}" image: "{{ qdrouterd_image_full }}"
volumes: "{{ qdrouterd_default_volumes + qdrouterd_extra_volumes }}" volumes: "{{ qdrouterd_default_volumes + qdrouterd_extra_volumes }}"
dimensions: "{{ qdrouterd_dimensions }}" dimensions: "{{ qdrouterd_dimensions }}"
healthcheck: "{{ qdrouterd_healthcheck }}"
#################### ####################
# Docker # Docker
@ -19,6 +21,19 @@ qdrouterd_tag: "{{ openstack_tag }}"
qdrouterd_image_full: "{{ qdrouterd_image }}:{{ qdrouterd_tag }}" qdrouterd_image_full: "{{ qdrouterd_image }}:{{ qdrouterd_tag }}"
qdrouterd_dimensions: "{{ default_container_dimensions }}" qdrouterd_dimensions: "{{ default_container_dimensions }}"
qdrouterd_enable_healthchecks: "{{ enable_container_healthchecks }}"
qdrouterd_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
qdrouterd_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
qdrouterd_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
qdrouterd_healthcheck_test: ["CMD-SHELL", "healthcheck_curl http://{{ api_interface_address | put_address_in_context('url') }}:{{ qdrouterd_port }}"]
qdrouterd_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
qdrouterd_healthcheck:
interval: "{{ qdrouterd_healthcheck_interval }}"
retries: "{{ qdrouterd_healthcheck_retries }}"
start_period: "{{ qdrouterd_healthcheck_start_period }}"
test: "{% if qdrouterd_enable_healthchecks | bool %}{{ qdrouterd_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ qdrouterd_healthcheck_timeout }}"
qdrouterd_default_volumes: qdrouterd_default_volumes:
- "{{ node_config_directory }}/qdrouterd/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/qdrouterd/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"

View File

@ -11,5 +11,6 @@
image: "{{ service.image }}" image: "{{ service.image }}"
volumes: "{{ service.volumes }}" volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}" dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when: when:
- kolla_action != "config" - kolla_action != "config"

View File

@ -8,6 +8,7 @@
image: "{{ item.value.image }}" image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: when:
- inventory_hostname in groups[item.value.group] - inventory_hostname in groups[item.value.group]
- item.value.enabled | bool - item.value.enabled | bool

View File

@ -0,0 +1,6 @@
---
features:
- |
Implements container healthchecks for qdrouterd services.
See `blueprint
<https://blueprints.launchpad.net/kolla-ansible/+spec/container-health-check>`__