Merge "Use Docker healthchecks for blazar services"

This commit is contained in:
Zuul 2021-03-26 10:26:28 +00:00 committed by Gerrit Code Review
commit b07ccdeaa0
4 changed files with 39 additions and 0 deletions

View File

@ -9,6 +9,7 @@ blazar_services:
image: "{{ blazar_api_image_full }}" image: "{{ blazar_api_image_full }}"
volumes: "{{ blazar_api_default_volumes + blazar_api_extra_volumes }}" volumes: "{{ blazar_api_default_volumes + blazar_api_extra_volumes }}"
dimensions: "{{ blazar_api_dimensions }}" dimensions: "{{ blazar_api_dimensions }}"
healthcheck: "{{ blazar_api_healthcheck }}"
haproxy: haproxy:
blazar_api: blazar_api:
enabled: "{{ enable_blazar }}" enabled: "{{ enable_blazar }}"
@ -27,6 +28,7 @@ blazar_services:
image: "{{ blazar_manager_image_full }}" image: "{{ blazar_manager_image_full }}"
volumes: "{{ blazar_manager_default_volumes + blazar_manager_extra_volumes }}" volumes: "{{ blazar_manager_default_volumes + blazar_manager_extra_volumes }}"
dimensions: "{{ blazar_manager_dimensions }}" dimensions: "{{ blazar_manager_dimensions }}"
healthcheck: "{{ blazar_manager_healthcheck }}"
#################### ####################
@ -59,6 +61,34 @@ blazar_api_image_full: "{{ blazar_api_image }}:{{ blazar_api_tag }}"
blazar_api_dimensions: "{{ default_container_dimensions }}" blazar_api_dimensions: "{{ default_container_dimensions }}"
blazar_manager_dimensions: "{{ default_container_dimensions }}" blazar_manager_dimensions: "{{ default_container_dimensions }}"
blazar_api_enable_healthchecks: "{{ enable_container_healthchecks }}"
blazar_api_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
blazar_api_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
blazar_api_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
# NOTE(wuchunyang): we don't use healthcheck_url because the api returns 401(Unauthorized) which is failed.
blazar_api_healthcheck_test: ["CMD-SHELL", "healthcheck_listen blazar-api {{ blazar_api_port }}"]
blazar_api_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
blazar_api_healthcheck:
interval: "{{ blazar_api_healthcheck_interval }}"
retries: "{{ blazar_api_healthcheck_retries }}"
start_period: "{{ blazar_api_healthcheck_start_period }}"
test: "{% if blazar_api_enable_healthchecks | bool %}{{ blazar_api_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ blazar_api_healthcheck_timeout }}"
blazar_manager_enable_healthchecks: "{{ enable_container_healthchecks }}"
blazar_manager_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
blazar_manager_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
blazar_manager_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
blazar_manager_healthcheck_test: ["CMD-SHELL", "healthcheck_port blazar-manager {{ om_rpc_port }}"]
blazar_manager_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
blazar_manager_healthcheck:
interval: "{{ blazar_manager_healthcheck_interval }}"
retries: "{{ blazar_manager_healthcheck_retries }}"
start_period: "{{ blazar_manager_healthcheck_start_period }}"
test: "{% if blazar_manager_enable_healthchecks | bool %}{{ blazar_manager_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ blazar_manager_healthcheck_timeout }}"
blazar_api_default_volumes: blazar_api_default_volumes:
- "{{ node_config_directory }}/blazar-api/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/blazar-api/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"

View File

@ -11,6 +11,7 @@
image: "{{ service.image }}" image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}" volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}" dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when: when:
- kolla_action != "config" - kolla_action != "config"
@ -26,5 +27,6 @@
image: "{{ service.image }}" image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}" volumes: "{{ service.volumes|reject('equalto', '')|list }}"
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|reject('equalto', '')|list }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
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 blazar services.
See `blueprint
<https://blueprints.launchpad.net/kolla-ansible/+spec/container-health-check>`__