diff --git a/ansible/roles/storm/defaults/main.yml b/ansible/roles/storm/defaults/main.yml index efadad23cd..1c9f77c318 100644 --- a/ansible/roles/storm/defaults/main.yml +++ b/ansible/roles/storm/defaults/main.yml @@ -12,6 +12,7 @@ storm_services: STORM_LOG4J_PROP: "{{ storm_log_settings }}" volumes: "{{ storm_worker_default_volumes + storm_nimbus_extra_volumes }}" dimensions: "{{ storm_worker_dimensions }}" + healthcheck: "{{ storm_worker_healthcheck }}" storm-nimbus: container_name: storm_nimbus group: storm-nimbus @@ -22,6 +23,8 @@ storm_services: STORM_LOG4J_PROP: "{{ storm_log_settings }}" volumes: "{{ storm_nimbus_default_volumes + storm_nimbus_extra_volumes }}" dimensions: "{{ storm_nimbus_dimensions }}" + healthcheck: "{{ storm_nimbus_healthcheck }}" + #################### # Storm @@ -40,6 +43,32 @@ storm_image_full: "{{ storm_image }}:{{ storm_tag }}" storm_worker_dimensions: "{{ default_container_dimensions }}" storm_nimbus_dimensions: "{{ default_container_dimensions }}" +storm_worker_enable_healthchecks: "{{ enable_container_healthchecks }}" +storm_worker_healthcheck_interval: "{{ default_container_healthcheck_interval }}" +storm_worker_healthcheck_retries: "{{ default_container_healthcheck_retries }}" +storm_worker_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}" +storm_worker_healthcheck_test: ["CMD-SHELL", "healthcheck_port java {{ zookeeper_client_port }}"] +storm_worker_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}" +storm_worker_healthcheck: + interval: "{{ storm_worker_healthcheck_interval }}" + retries: "{{ storm_worker_healthcheck_retries }}" + start_period: "{{ storm_worker_healthcheck_start_period }}" + test: "{% if storm_worker_enable_healthchecks | bool %}{{ storm_worker_healthcheck_test }}{% else %}NONE{% endif %}" + timeout: "{{ storm_worker_healthcheck_timeout }}" + +storm_nimbus_enable_healthchecks: "{{ enable_container_healthchecks }}" +storm_nimbus_healthcheck_interval: "{{ default_container_healthcheck_interval }}" +storm_nimbus_healthcheck_retries: "{{ default_container_healthcheck_retries }}" +storm_nimbus_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}" +storm_nimbus_healthcheck_test: ["CMD-SHELL", "healthcheck_listen java {{ storm_nimbus_thrift_port }}"] +storm_nimbus_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}" +storm_nimbus_healthcheck: + interval: "{{ storm_nimbus_healthcheck_interval }}" + retries: "{{ storm_nimbus_healthcheck_retries }}" + start_period: "{{ storm_nimbus_healthcheck_start_period }}" + test: "{% if storm_nimbus_enable_healthchecks | bool %}{{ storm_nimbus_healthcheck_test }}{% else %}NONE{% endif %}" + timeout: "{{ storm_nimbus_healthcheck_timeout }}" + storm_worker_default_volumes: - "{{ node_config_directory }}/storm-worker/:{{ container_config_directory }}/" - "/etc/localtime:/etc/localtime:ro" diff --git a/ansible/roles/storm/handlers/main.yml b/ansible/roles/storm/handlers/main.yml index 3818b5c993..3766bef9da 100644 --- a/ansible/roles/storm/handlers/main.yml +++ b/ansible/roles/storm/handlers/main.yml @@ -12,6 +12,7 @@ environment: "{{ service.environment }}" volumes: "{{ service.volumes }}" dimensions: "{{ service.dimensions }}" + healthcheck: "{{ service.healthcheck | default(omit) }}" when: - kolla_action != "config" @@ -28,5 +29,6 @@ environment: "{{ service.environment }}" volumes: "{{ service.volumes }}" dimensions: "{{ service.dimensions }}" + healthcheck: "{{ service.healthcheck | default(omit) }}" when: - kolla_action != "config" diff --git a/ansible/roles/storm/tasks/check-containers.yml b/ansible/roles/storm/tasks/check-containers.yml index e0204778f2..8d32f26aaf 100644 --- a/ansible/roles/storm/tasks/check-containers.yml +++ b/ansible/roles/storm/tasks/check-containers.yml @@ -9,6 +9,7 @@ volumes: "{{ item.value.volumes }}" environment: "{{ item.value.environment }}" dimensions: "{{ item.value.dimensions }}" + healthcheck: "{{ item.value.healthcheck | default(omit) }}" when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool diff --git a/releasenotes/notes/implement-docker-healthchecks-for-storm-10d460e9b8f08a74.yaml b/releasenotes/notes/implement-docker-healthchecks-for-storm-10d460e9b8f08a74.yaml new file mode 100644 index 0000000000..83a73bf210 --- /dev/null +++ b/releasenotes/notes/implement-docker-healthchecks-for-storm-10d460e9b8f08a74.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Implements container healthchecks for storm services. + See `blueprint + `__