kolla-ansible/ansible/roles/gnocchi/defaults/main.yml
LinPeiWen 3e9ad63187 Use Docker healthchecks for gnocchi services
This change enables the use of Docker healthchecks for gnocchi services.
Implements: blueprint container-health-check

Change-Id: Ib1eb766d061c376c0bdd693dd6ea1e5b3e3fc02a
2021-03-08 14:27:33 +00:00

176 lines
8.0 KiB
YAML

---
project_name: "gnocchi"
gnocchi_services:
gnocchi-api:
container_name: gnocchi_api
group: gnocchi-api
enabled: true
image: "{{ gnocchi_api_image_full }}"
volumes: "{{ gnocchi_api_default_volumes + gnocchi_api_extra_volumes }}"
dimensions: "{{ gnocchi_api_dimensions }}"
healthcheck: "{{ gnocchi_api_healthcheck }}"
haproxy:
gnocchi_api:
enabled: "{{ enable_gnocchi }}"
mode: "http"
external: false
port: "{{ gnocchi_api_listen_port }}"
gnocchi_api_external:
enabled: "{{ enable_gnocchi }}"
mode: "http"
external: true
port: "{{ gnocchi_api_listen_port }}"
gnocchi-metricd:
container_name: gnocchi_metricd
group: gnocchi-metricd
enabled: true
image: "{{ gnocchi_metricd_image_full }}"
volumes: "{{ gnocchi_metricd_default_volumes + gnocchi_metricd_extra_volumes }}"
dimensions: "{{ gnocchi_metricd_dimensions }}"
healthcheck: "{{ gnocchi_metricd_healthcheck }}"
gnocchi-statsd:
container_name: gnocchi_statsd
group: gnocchi-statsd
enabled: "{{ enable_gnocchi_statsd | bool }}"
image: "{{ gnocchi_statsd_image_full }}"
volumes: "{{ gnocchi_statsd_default_volumes + gnocchi_statsd_extra_volumes }}"
dimensions: "{{ gnocchi_statsd_dimensions }}"
healthcheck: "{{ gnocchi_statsd_healthcheck }}"
####################
# Swift
####################
swift_keystone_user: "swift"
swift_admin_tenant_name: "admin"
####################
# Database
####################
gnocchi_database_name: "gnocchi"
gnocchi_database_user: "{% if use_preconfigured_databases | bool and use_common_mariadb_user | bool %}{{ database_user }}{% else %}gnocchi{% endif %}"
gnocchi_database_address: "{{ database_address | put_address_in_context('url') }}:{{ database_port }}"
####################
# Docker
####################
gnocchi_install_type: "{{ kolla_install_type }}"
gnocchi_tag: "{{ openstack_tag }}"
gnocchi_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ gnocchi_install_type }}-gnocchi-api"
gnocchi_api_tag: "{{ gnocchi_tag }}"
gnocchi_api_image_full: "{{ gnocchi_api_image }}:{{ gnocchi_api_tag }}"
gnocchi_statsd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ gnocchi_install_type }}-gnocchi-statsd"
gnocchi_statsd_tag: "{{ gnocchi_tag }}"
gnocchi_statsd_image_full: "{{ gnocchi_statsd_image }}:{{ gnocchi_statsd_tag }}"
gnocchi_metricd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ gnocchi_install_type }}-gnocchi-metricd"
gnocchi_metricd_tag: "{{ gnocchi_tag }}"
gnocchi_metricd_image_full: "{{ gnocchi_metricd_image }}:{{ gnocchi_metricd_tag }}"
gnocchi_api_dimensions: "{{ default_container_dimensions }}"
gnocchi_metricd_dimensions: "{{ default_container_dimensions }}"
gnocchi_statsd_dimensions: "{{ default_container_dimensions }}"
gnocchi_api_enable_healthchecks: "{{ enable_container_healthchecks }}"
gnocchi_api_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
gnocchi_api_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
gnocchi_api_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
gnocchi_api_healthcheck_test: ["CMD-SHELL", "healthcheck_curl http://{{ api_interface_address | put_address_in_context('url') }}:{{ gnocchi_api_listen_port }}"]
gnocchi_api_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
gnocchi_api_healthcheck:
interval: "{{ gnocchi_api_healthcheck_interval }}"
retries: "{{ gnocchi_api_healthcheck_retries }}"
start_period: "{{ gnocchi_api_healthcheck_start_period }}"
test: "{% if gnocchi_api_enable_healthchecks | bool %}{{ gnocchi_api_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ gnocchi_api_healthcheck_timeout }}"
gnocchi_metricd_enable_healthchecks: "{{ enable_container_healthchecks }}"
gnocchi_metricd_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
gnocchi_metricd_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
gnocchi_metricd_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
gnocchi_metricd_healthcheck_test: ["CMD-SHELL", "healthcheck_port gnocchi-metricd {{ database_port }}"]
gnocchi_metricd_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
gnocchi_metricd_healthcheck:
interval: "{{ gnocchi_metricd_healthcheck_interval }}"
retries: "{{ gnocchi_metricd_healthcheck_retries }}"
start_period: "{{ gnocchi_metricd_healthcheck_start_period }}"
test: "{% if gnocchi_metricd_enable_healthchecks | bool %}{{ gnocchi_metricd_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ gnocchi_metricd_healthcheck_timeout }}"
gnocchi_statsd_enable_healthchecks: "{{ enable_container_healthchecks }}"
gnocchi_statsd_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
gnocchi_statsd_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
gnocchi_statsd_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
gnocchi_statsd_healthcheck_test: ["CMD-SHELL", "healthcheck_port gnocchi-statsd {{ database_port }}"]
gnocchi_statsd_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
gnocchi_statsd_healthcheck:
interval: "{{ gnocchi_statsd_healthcheck_interval }}"
retries: "{{ gnocchi_statsd_healthcheck_retries }}"
start_period: "{{ gnocchi_statsd_healthcheck_start_period }}"
test: "{% if gnocchi_statsd_enable_healthchecks | bool %}{{ gnocchi_statsd_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ gnocchi_statsd_healthcheck_timeout }}"
gnocchi_api_default_volumes:
- "{{ node_config_directory }}/gnocchi-api/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}"
- "{{ gnocchi_metric_datadir_volume }}:/var/lib/gnocchi/"
- "kolla_logs:/var/log/kolla/"
gnocchi_metricd_default_volumes:
- "{{ node_config_directory }}/gnocchi-metricd/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}"
- "{{ gnocchi_metric_datadir_volume }}:/var/lib/gnocchi/"
- "kolla_logs:/var/log/kolla/"
gnocchi_statsd_default_volumes:
- "{{ node_config_directory }}/gnocchi-statsd/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}"
- "{{ gnocchi_metric_datadir_volume }}:/var/lib/gnocchi/"
- "kolla_logs:/var/log/kolla/"
gnocchi_extra_volumes: "{{ default_extra_volumes }}"
gnocchi_api_extra_volumes: "{{ gnocchi_extra_volumes }}"
gnocchi_metricd_extra_volumes: "{{ gnocchi_extra_volumes }}"
gnocchi_statsd_extra_volumes: "{{ gnocchi_extra_volumes }}"
####################
# OpenStack
####################
gnocchi_admin_endpoint: "{{ admin_protocol }}://{{ gnocchi_internal_fqdn | put_address_in_context('url') }}:{{ gnocchi_api_port }}"
gnocchi_internal_endpoint: "{{ internal_protocol }}://{{ gnocchi_internal_fqdn | put_address_in_context('url') }}:{{ gnocchi_api_port }}"
gnocchi_public_endpoint: "{{ public_protocol }}://{{ gnocchi_external_fqdn | put_address_in_context('url') }}:{{ gnocchi_api_port }}"
gnocchi_logging_debug: "{{ openstack_logging_debug }}"
gnocchi_metricd_workers: "{{ openstack_service_workers }}"
gnocchi_keystone_user: "gnocchi"
openstack_gnocchi_auth: "{{ openstack_auth }}"
####################
# Keystone
####################
gnocchi_ks_services:
- name: "gnocchi"
type: "metric"
description: "OpenStack Metric Service"
endpoints:
- {'interface': 'admin', 'url': '{{ gnocchi_admin_endpoint }}'}
- {'interface': 'internal', 'url': '{{ gnocchi_internal_endpoint }}'}
- {'interface': 'public', 'url': '{{ gnocchi_public_endpoint }}'}
gnocchi_ks_users:
- project: "service"
user: "{{ gnocchi_keystone_user }}"
password: "{{ gnocchi_keystone_password }}"
role: "admin"