Use Docker healthchecks for tacker services

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

Change-Id: Ib33863e4bf78f73a28d82b222ab349909ebb6671
This commit is contained in:
wuchunyang 2021-03-02 19:44:32 +08:00
parent a8981a79aa
commit 7bab7d0d27
4 changed files with 37 additions and 0 deletions

View File

@ -10,6 +10,7 @@ tacker_services:
image: "{{ tacker_server_image_full }}"
volumes: "{{ tacker_server_default_volumes + tacker_server_extra_volumes }}"
dimensions: "{{ tacker_server_dimensions }}"
healthcheck: "{{ tacker_server_healthcheck }}"
haproxy:
tacker_server:
enabled: "{{ enable_tacker }}"
@ -31,6 +32,7 @@ tacker_services:
image: "{{ tacker_conductor_image_full }}"
volumes: "{{ tacker_conductor_default_volumes + tacker_conductor_extra_volumes }}"
dimensions: "{{ tacker_conductor_dimensions }}"
healthcheck: "{{ tacker_conductor_healthcheck }}"
####################
# Database
@ -56,6 +58,32 @@ tacker_conductor_image_full: "{{ tacker_conductor_image }}:{{ tacker_conductor_t
tacker_server_dimensions: "{{ default_container_dimensions }}"
tacker_conductor_dimensions: "{{ default_container_dimensions }}"
tacker_server_enable_healthchecks: "{{ enable_container_healthchecks }}"
tacker_server_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
tacker_server_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
tacker_server_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
tacker_server_healthcheck_test: ["CMD-SHELL", "healthcheck_curl http://{{ api_interface_address | put_address_in_context('url') }}:{{ tacker_server_port }}"]
tacker_server_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
tacker_server_healthcheck:
interval: "{{ tacker_server_healthcheck_interval }}"
retries: "{{ tacker_server_healthcheck_retries }}"
start_period: "{{ tacker_server_healthcheck_start_period }}"
test: "{% if tacker_server_enable_healthchecks | bool %}{{ tacker_server_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ tacker_server_healthcheck_timeout }}"
tacker_conductor_enable_healthchecks: "{{ enable_container_healthchecks }}"
tacker_conductor_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
tacker_conductor_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
tacker_conductor_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
tacker_conductor_healthcheck_test: ["CMD-SHELL", "healthcheck_port tacker-conductor {{ om_rpc_port }}"]
tacker_conductor_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
tacker_conductor_healthcheck:
interval: "{{ tacker_conductor_healthcheck_interval }}"
retries: "{{ tacker_conductor_healthcheck_retries }}"
start_period: "{{ tacker_conductor_healthcheck_start_period }}"
test: "{% if tacker_conductor_enable_healthchecks | bool %}{{ tacker_conductor_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ tacker_conductor_healthcheck_timeout }}"
tacker_server_default_volumes:
- "{{ node_config_directory }}/tacker-server/:{{ container_config_directory }}/:ro"
- "{{ kolla_dev_repos_directory ~ '/tacker/tacker:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/tacker' if tacker_dev_mode | bool else '' }}"

View File

@ -11,6 +11,7 @@
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when:
- kolla_action != "config"
@ -26,5 +27,6 @@
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when:
- kolla_action != "config"

View File

@ -7,6 +7,7 @@
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when:
- item.value.host_in_groups | bool
- item.value.enabled | bool

View File

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