Merge "Support deploying Monasca Persister"

This commit is contained in:
Zuul 2018-10-03 14:19:50 +00:00 committed by Gerrit Code Review
commit 9355f17f2d
9 changed files with 112 additions and 2 deletions

View File

@ -466,6 +466,9 @@ monasca
[monasca-notification:children]
monasca
[monasca-persister:children]
monasca
# Storm
[storm-worker:children]
storm

View File

@ -475,6 +475,9 @@ monasca
[monasca-notification:children]
monasca
[monasca-persister:children]
monasca
# Storm
[storm-worker:children]
storm

View File

@ -93,6 +93,16 @@ monasca_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla"
dimensions: "{{ monasca_notification_dimensions }}"
monasca-persister:
container_name: monasca_persister
group: monasca-persister
enabled: true
image: "{{ monasca_persister_image_full }}"
volumes:
- "{{ node_config_directory }}/monasca-persister/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla"
dimensions: "{{ monasca_persister_dimensions }}"
####################
# Databases
@ -162,6 +172,10 @@ monasca_notification_image: "{{ docker_registry ~ '/' if docker_registry else ''
monasca_notification_tag: "{{ monasca_tag }}"
monasca_notification_image_full: "{{ monasca_notification_image }}:{{ monasca_notification_tag }}"
monasca_persister_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ monasca_install_type }}-monasca-persister"
monasca_persister_tag: "{{ monasca_tag }}"
monasca_persister_image_full: "{{ monasca_persister_image }}:{{ monasca_persister_tag }}"
monasca_api_dimensions: "{{ default_container_dimensions }}"
monasca_log_api_dimensions: "{{ default_container_dimensions }}"
monasca_log_transformer_dimensions: "{{ default_container_dimensions }}"
@ -169,6 +183,7 @@ monasca_log_persister_dimensions: "{{ default_container_dimensions }}"
monasca_log_metrics_dimensions: "{{ default_container_dimensions }}"
monasca_thresh_dimensions: "{{ default_container_dimensions }}"
monasca_notification_dimensions: "{{ default_container_dimensions }}"
monasca_persister_dimensions: "{{ default_container_dimensions }}"
####################

View File

@ -150,3 +150,23 @@
- config_json.changed | bool
or monasca_notification_confs.changed | bool
or monasca_notification_container.changed | bool
- name: Restart monasca-persister container
vars:
service_name: "monasca-persister"
service: "{{ monasca_services[service_name] }}"
config_json: "{{ monasca_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
monasca_persister_container: "{{ check_monasca_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
kolla_docker:
action: "recreate_or_restart_container"
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
- service.enabled | bool
- config_json.changed | bool
or monasca_persister_confs.changed | bool
or monasca_persister_container.changed | bool

View File

@ -236,6 +236,26 @@
notify:
- Restart monasca-notification container
- name: Copying over monasca-persister config
vars:
service: "{{ monasca_services['monasca-persister'] }}"
merge_configs:
sources:
- "{{ role_path }}/templates/monasca-persister/{{ item }}.j2"
- "{{ node_custom_config }}/monasca/{{ item }}"
- "{{ node_custom_config }}/monasca/{{ inventory_hostname }}/{{ item }}"
dest: "{{ node_config_directory }}/monasca-persister/{{ item }}"
mode: "0660"
become: true
register: monasca_persister_confs
with_items:
- persister.conf
when:
- inventory_hostname in groups[service['group']]
- service.enabled | bool
notify:
- Restart monasca-persister container
- name: Check monasca containers
become: true
kolla_docker:

View File

@ -10,7 +10,8 @@
inventory_hostname in groups['monasca-log-persister'] or
inventory_hostname in groups['monasca-log-metrics'] or
inventory_hostname in groups['monasca-thresh'] or
inventory_hostname in groups['monasca-notification']
inventory_hostname in groups['monasca-notification'] or
inventory_hostname in groups['monasca-persister']
- include_tasks: bootstrap.yml
when: inventory_hostname in groups['monasca-api']
@ -25,4 +26,5 @@
inventory_hostname in groups['monasca-log-persister'] or
inventory_hostname in groups['monasca-log-metrics'] or
inventory_hostname in groups['monasca-thresh'] or
inventory_hostname in groups['monasca-notification']
inventory_hostname in groups['monasca-notification'] or
inventory_hostname in groups['monasca-persister']

View File

@ -0,0 +1,18 @@
{
"command": "monasca-persister --config-file /etc/monasca/persister.conf",
"config_files": [
{
"source": "{{ container_config_directory }}/persister.conf",
"dest": "/etc/monasca/persister.conf",
"owner": "monasca",
"perm": "0600"
}
],
"permissions": [
{
"path": "/var/log/kolla/monasca",
"owner": "monasca:kolla",
"recurse": true
}
]
}

View File

@ -0,0 +1,23 @@
[DEFAULT]
log_file = monasca-persister.log
log_dir = /var/log/kolla/monasca
debug = {{ monasca_logging_debug }}
[influxdb]
database_name = {{ monasca_influxdb_name }}
# FIXME(dszumski): This doesn't work with a FQDN so use the VIP directly
ip_address = {{ kolla_internal_vip_address }}
port = {{ monasca_influxdb_http_port }}
[kafka_alarm_history]
uri = {{ monasca_kafka_servers }}
topic = {{ monasca_alarm_state_transitions_topic }}
num_processors = 1
[kafka_metrics]
uri = {{ monasca_kafka_servers }}
topic = {{ monasca_metrics_topic }}
num_processors = 1
[zookeeper]
uri = {{ monasca_zookeeper_servers }}

View File

@ -0,0 +1,6 @@
---
features:
- |
Add support for deploying the Monasca Persister process. The
Persister is responsible for reading metrics, alarms and events
from Kafka and storing them in a variety of backends.