Use Docker healthchecks for skydive services

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

Change-Id: I2e18f2d912dad92a327261e092da358911531ebe
This commit is contained in:
LinPeiWen 2021-03-03 09:37:42 +00:00
parent 1b1d06a9d7
commit 9688635e42
4 changed files with 37 additions and 0 deletions

View File

@ -9,6 +9,7 @@ skydive_services:
image: "{{ skydive_analyzer_image_full }}"
volumes: "{{ skydive_analyzer_default_volumes + skydive_analyzer_extra_volumes }}"
dimensions: "{{ skydive_analyzer_dimensions }}"
healthcheck: "{{ skydive_analyzer_healthcheck }}"
haproxy:
skydive_server:
enabled: "{{ enable_skydive }}"
@ -28,6 +29,7 @@ skydive_services:
privileged: True
volumes: "{{ skydive_agent_default_volumes + skydive_agent_extra_volumes }}"
dimensions: "{{ skydive_agent_dimensions }}"
healthcheck: "{{ skydive_agent_healthcheck }}"
####################
# Docker
@ -44,6 +46,32 @@ skydive_agent_image_full: "{{ skydive_agent_image }}:{{ skydive_agent_tag }}"
skydive_analyzer_dimensions: "{{ default_container_dimensions }}"
skydive_agent_dimensions: "{{ default_container_dimensions }}"
skydive_analyzer_enable_healthchecks: "{{ enable_container_healthchecks }}"
skydive_analyzer_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
skydive_analyzer_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
skydive_analyzer_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
skydive_analyzer_healthcheck_test: ["CMD-SHELL", "healthcheck_listen skydive {{ skydive_analyzer_port }}"]
skydive_analyzer_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
skydive_analyzer_healthcheck:
interval: "{{ skydive_analyzer_healthcheck_interval }}"
retries: "{{ skydive_analyzer_healthcheck_retries }}"
start_period: "{{ skydive_analyzer_healthcheck_start_period }}"
test: "{% if skydive_analyzer_enable_healthchecks | bool %}{{ skydive_analyzer_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ skydive_analyzer_healthcheck_timeout }}"
skydive_agent_enable_healthchecks: "{{ enable_container_healthchecks }}"
skydive_agent_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
skydive_agent_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
skydive_agent_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
skydive_agent_healthcheck_test: ["CMD-SHELL", "healthcheck_listen skydive {{ skydive_agents_port }}"]
skydive_agent_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
skydive_agent_healthcheck:
interval: "{{ skydive_agent_healthcheck_interval }}"
retries: "{{ skydive_agent_healthcheck_retries }}"
start_period: "{{ skydive_agent_healthcheck_start_period }}"
test: "{% if skydive_agent_enable_healthchecks | bool %}{{ skydive_agent_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ skydive_agent_healthcheck_timeout }}"
skydive_analyzer_default_volumes:
- "{{ node_config_directory }}/skydive-analyzer/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"

View File

@ -11,6 +11,7 @@
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when:
- kolla_action != "config"
@ -27,5 +28,6 @@
privileged: "{{ service.privileged }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when:
- kolla_action != "config"

View File

@ -9,6 +9,7 @@
privileged: "{{ item.value.privileged | default(False) }}"
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

View File

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