Use Docker healthchecks for zookeeper services

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

Change-Id: I344115580840f3aa3f872c6136492f7bd7b73db8
This commit is contained in:
LinPeiWen 2021-03-08 10:51:23 +00:00 committed by Lin PeiWen
parent cef8c8b3de
commit de5624e8e9
4 changed files with 23 additions and 0 deletions

View File

@ -12,6 +12,8 @@ zookeeper_services:
ZOO_LOG4J_PROP: "{{ zookeeper_log_settings }}" ZOO_LOG4J_PROP: "{{ zookeeper_log_settings }}"
volumes: "{{ zookeeper_default_volumes + zookeeper_extra_volumes }}" volumes: "{{ zookeeper_default_volumes + zookeeper_extra_volumes }}"
dimensions: "{{ zookeeper_dimensions }}" dimensions: "{{ zookeeper_dimensions }}"
healthcheck: "{{ zookeeper_healthcheck }}"
#################### ####################
# Zookeeper # Zookeeper
@ -27,6 +29,19 @@ zookeeper_tag: "{{ openstack_tag }}"
zookeeper_image_full: "{{ zookeeper_image }}:{{ zookeeper_tag }}" zookeeper_image_full: "{{ zookeeper_image }}:{{ zookeeper_tag }}"
zookeeper_dimensions: "{{ default_container_dimensions }}" zookeeper_dimensions: "{{ default_container_dimensions }}"
zookeeper_enable_healthchecks: "{{ enable_container_healthchecks }}"
zookeeper_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
zookeeper_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
zookeeper_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
zookeeper_healthcheck_test: ["CMD-SHELL", "healthcheck_listen java {{ zookeeper_client_port }}"]
zookeeper_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
zookeeper_healthcheck:
interval: "{{ zookeeper_healthcheck_interval }}"
retries: "{{ zookeeper_healthcheck_retries }}"
start_period: "{{ zookeeper_healthcheck_start_period }}"
test: "{% if zookeeper_enable_healthchecks | bool %}{{ zookeeper_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ zookeeper_healthcheck_timeout }}"
zookeeper_default_volumes: zookeeper_default_volumes:
- "{{ node_config_directory }}/zookeeper/:{{ container_config_directory }}/" - "{{ node_config_directory }}/zookeeper/:{{ container_config_directory }}/"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"

View File

@ -12,5 +12,6 @@
environment: "{{ service.environment }}" environment: "{{ service.environment }}"
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

@ -9,6 +9,7 @@
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
environment: "{{ item.value.environment }}" environment: "{{ item.value.environment }}"
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 zookeeper services.
See `blueprint
<https://blueprints.launchpad.net/kolla-ansible/+spec/container-health-check>`__