Skip to content
Snippets Groups Projects
Commit e2d2bc42 authored by Zuul's avatar Zuul Committed by Gerrit Code Review
Browse files

Merge "Use Docker healthchecks for redis services"

parents b07ccdea 66888bb7
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ redis_services:
image: "{{ redis_image_full }}"
volumes: "{{ redis_default_volumes + redis_extra_volumes }}"
dimensions: "{{ redis_dimensions }}"
healthcheck: "{{ redis_healthcheck }}"
redis-sentinel:
container_name: redis_sentinel
group: redis
......@@ -16,6 +17,7 @@ redis_services:
image: "{{ redis_sentinel_image_full }}"
volumes: "{{ redis_sentinel_default_volumes + redis_sentinel_extra_volumes }}"
dimensions: "{{ redis_sentinel_dimensions }}"
healthcheck: "{{ redis_sentinel_healthcheck }}"
####################
# Docker
......@@ -31,6 +33,32 @@ redis_sentinel_image_full: "{{ redis_sentinel_image }}:{{ redis_tag }}"
redis_dimensions: "{{ default_container_dimensions }}"
redis_sentinel_dimensions: "{{ default_container_dimensions }}"
redis_enable_healthchecks: "{{ enable_container_healthchecks }}"
redis_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
redis_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
redis_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
redis_healthcheck_test: ["CMD-SHELL", "healthcheck_listen redis-server {{ redis_port }}"]
redis_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
redis_healthcheck:
interval: "{{ redis_healthcheck_interval }}"
retries: "{{ redis_healthcheck_retries }}"
start_period: "{{ redis_healthcheck_start_period }}"
test: "{% if redis_enable_healthchecks | bool %}{{ redis_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ redis_healthcheck_timeout }}"
redis_sentinel_enable_healthchecks: "{{ enable_container_healthchecks }}"
redis_sentinel_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
redis_sentinel_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
redis_sentinel_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
redis_sentinel_healthcheck_test: ["CMD-SHELL", "healthcheck_listen redis-sentinel {{ redis_sentinel_port }}"]
redis_sentinel_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
redis_sentinel_healthcheck:
interval: "{{ redis_sentinel_healthcheck_interval }}"
retries: "{{ redis_sentinel_healthcheck_retries }}"
start_period: "{{ redis_sentinel_healthcheck_start_period }}"
test: "{% if redis_sentinel_enable_healthchecks | bool %}{{ redis_sentinel_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ redis_sentinel_healthcheck_timeout }}"
redis_default_volumes:
- "{{ node_config_directory }}/redis/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
......
......@@ -11,6 +11,7 @@
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when:
- kolla_action != "config"
......@@ -26,5 +27,6 @@
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when:
- kolla_action != "config"
......@@ -8,6 +8,7 @@
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
......
---
features:
- |
Implements container healthchecks for redis services.
See `blueprint
<https://blueprints.launchpad.net/kolla-ansible/+spec/container-health-check>`__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment