Merge "Use Docker healthchecks for elasticsearch services"

This commit is contained in:
Zuul 2021-03-26 10:24:36 +00:00 committed by Gerrit Code Review
commit 1d1d2aaefa
4 changed files with 22 additions and 0 deletions

View File

@ -11,6 +11,7 @@ elasticsearch_services:
ES_JAVA_OPTS: "{{ es_java_opts }}" ES_JAVA_OPTS: "{{ es_java_opts }}"
volumes: "{{ elasticsearch_default_volumes + elasticsearch_extra_volumes }}" volumes: "{{ elasticsearch_default_volumes + elasticsearch_extra_volumes }}"
dimensions: "{{ elasticsearch_dimensions }}" dimensions: "{{ elasticsearch_dimensions }}"
healthcheck: "{{ elasticsearch_healthcheck }}"
haproxy: haproxy:
elasticsearch: elasticsearch:
enabled: "{{ enable_elasticsearch }}" enabled: "{{ enable_elasticsearch }}"
@ -101,6 +102,19 @@ elasticsearch_curator_image_full: "{{ elasticsearch_curator_image }}:{{ elastics
elasticsearch_dimensions: "{{ default_container_dimensions }}" elasticsearch_dimensions: "{{ default_container_dimensions }}"
elasticsearch_curator_dimensions: "{{ default_container_dimensions }}" elasticsearch_curator_dimensions: "{{ default_container_dimensions }}"
elasticsearch_enable_healthchecks: "{{ enable_container_healthchecks }}"
elasticsearch_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
elasticsearch_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
elasticsearch_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
elasticsearch_healthcheck_test: ["CMD-SHELL", "healthcheck_curl http://{{ api_interface_address | put_address_in_context('url') }}:{{ elasticsearch_port }}"]
elasticsearch_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
elasticsearch_healthcheck:
interval: "{{ elasticsearch_healthcheck_interval }}"
retries: "{{ elasticsearch_healthcheck_retries }}"
start_period: "{{ elasticsearch_healthcheck_start_period }}"
test: "{% if elasticsearch_enable_healthchecks | bool %}{{ elasticsearch_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ elasticsearch_healthcheck_timeout }}"
elasticsearch_default_volumes: elasticsearch_default_volumes:
- "{{ node_config_directory }}/elasticsearch/:{{ container_config_directory }}/" - "{{ node_config_directory }}/elasticsearch/:{{ container_config_directory }}/"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"

View File

@ -12,6 +12,7 @@
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

@ -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) }}"
environment: "{{ item.value.environment|default(omit) }}" environment: "{{ item.value.environment|default(omit) }}"
when: when:
- inventory_hostname in groups[item.value.group] - inventory_hostname in groups[item.value.group]

View File

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