Use Docker healthchecks for memcached services

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

Change-Id: I571e6d6cac634fd86429e12b946d6f7b4a2ab02c
This commit is contained in:
LinPeiWen 2021-03-30 03:12:01 +00:00
parent 0a2b80eed8
commit 3c1fd44092
4 changed files with 22 additions and 0 deletions

View File

@ -9,6 +9,7 @@ memcached_services:
group: "memcached"
volumes: "{{ memcached_default_volumes + memcached_extra_volumes }}"
dimensions: "{{ memcached_dimensions }}"
healthcheck: "{{ memcached_healthcheck }}"
haproxy:
memcached:
enabled: "{{ enable_memcached|bool and enable_haproxy_memcached|bool }}"
@ -36,6 +37,19 @@ memcached_tag: "{{ openstack_tag }}"
memcached_image_full: "{{ memcached_image }}:{{ memcached_tag }}"
memcached_dimensions: "{{ default_container_dimensions }}"
memcached_enable_healthchecks: "{{ enable_container_healthchecks }}"
memcached_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
memcached_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
memcached_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
memcached_healthcheck_test: ["CMD-SHELL", "healthcheck_listen memcached {{ memcached_port }}"]
memcached_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
memcached_healthcheck:
interval: "{{ memcached_healthcheck_interval }}"
retries: "{{ memcached_healthcheck_retries }}"
start_period: "{{ memcached_healthcheck_start_period }}"
test: "{% if memcached_enable_healthchecks | bool %}{{ memcached_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ memcached_healthcheck_timeout }}"
memcached_default_volumes:
- "{{ node_config_directory }}/memcached/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"

View File

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

View File

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

View File

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