Added Kibana and its deployment.

Part of ELK stack. Includes Dockerfiles for both Centos and Ubuntu.

Change-Id: I1d955a5c51e416cc572eb2c9b4c57982a1d6ab67
Partially-implements: blueprint central-logging-service
This commit is contained in:
akwasniewska 2016-01-20 08:27:00 +01:00 committed by Alicja Kwasniewska
parent 0de0511e3b
commit 3672152d9d
14 changed files with 134 additions and 1 deletions

View File

@ -122,6 +122,9 @@ rgw_port: "6780"
mistral_api_port: "8989"
kibana_port: "5601"
elasticsearch_port: "9200"
####################
# Openstack options
####################
@ -174,7 +177,7 @@ enable_murano: "no"
enable_ironic: "no"
enable_magnum: "no"
enable_mistral: "no"
enable_elk: "no"
ironic_keystone_user: "ironic"
# Nova fake driver and the number of fake driver per compute node

View File

@ -15,6 +15,9 @@ localhost ansible_connection=local
# You can explicitly specify which hosts run each project by updating the
# groups in the sections below. Common services are grouped together.
[kibana:children]
control
[haproxy:children]
network

View File

@ -27,6 +27,9 @@ storage01
# You can explicitly specify which hosts run each project by updating the
# groups in the sections below. Common services are grouped together.
[kibana:children]
control
[haproxy:children]
network

View File

@ -0,0 +1,24 @@
---
####################
# Kibana
####################
kibana_port: "{{ kibana_port }}"
kibana_host: "{{ kolla_internal_address }}"
kibana_app_id: "discover"
kibana_request_timeout: 300000
kibana_shard_timeout: 0
kibana_verify_ssl: false
####################
# Docker
####################
kibana_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-kibana"
kibana_tag: "{{ openstack_release }}"
kibana_image_full: "{{ kibana_image }}:{{ kibana_tag }}"
####################
# Elasticsearch
####################
elasticsearch_preserve_host: "true"

View File

@ -0,0 +1,3 @@
---
dependencies:
- { role: common }

View File

@ -0,0 +1,22 @@
---
- name: Ensuring kibana config directories exist
file:
path: "{{ node_config_directory }}/{{ item }}"
state: "directory"
recurse: yes
with_items:
- "kibana"
- name: Copying over config.json files for services
template:
src: "{{ item }}.json.j2"
dest: "{{ node_config_directory }}/{{ item }}/config.json"
with_items:
- "kibana"
- name: Copying over Kibana configuration file
template:
src: "{{ item }}.yml.j2"
dest: "{{ node_config_directory }}/{{ item }}/{{ item }}.yml"
with_items:
- "kibana"

View File

@ -0,0 +1,4 @@
---
- include: config.yml
- include: start.yml

View File

@ -0,0 +1,2 @@
---
- include: "{{ action }}.yml"

View File

@ -0,0 +1,5 @@
- name: Pulling Kibana image
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ kibana_image_full }}"

View File

@ -0,0 +1,9 @@
---
- name: Starting Kibana container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ kibana_image_full }}"
name: "kibana"
volumes:
- "{{ node_config_directory }}/kibana/:{{ container_config_directory }}/:ro"

View File

@ -0,0 +1,11 @@
{
"command": "/opt/kibana/bin/kibana",
"config_files": [
{
"source": "{{ container_config_directory }}/kibana.yml",
"dest": "/opt/kibana/config/kibana.yml",
"owner": "kibana",
"perm": "0640"
}
]
}

View File

@ -0,0 +1,19 @@
port: {{ kibana_port }}
host: {{ kibana_host }}
elasticsearch_url: "http://{{ kolla_internal_address }}:{{ elasticsearch_port }}"
elasticsearch_preserve_host: {{ elasticsearch_preserve_host }}
default_app_id: {{ kibana_app_id }}
request_timeout: {{ kibana_request_timeout }}
shard_timeout: {{ kibana_shard_timeout }}
verify_ssl: {{ kibana_verify_ssl }}
bundled_plugin_ids:
- plugins/dashboard/index
- plugins/discover/index
- plugins/doc/index
- plugins/kibana/index
- plugins/markdown_vis/index
- plugins/metric_vis/index
- plugins/settings/index
- plugins/table_vis/index
- plugins/vis_types/index
- plugins/visualize/index

View File

@ -26,6 +26,12 @@
tags: haproxy,
when: enable_haproxy | bool }
- hosts: kibana
roles:
- { role: kibana,
tags: kibana,
when: enable_elk | bool }
- hosts: memcached
roles:
- { role: memcached,

View File

@ -0,0 +1,19 @@
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
MAINTAINER {{ maintainer }}
ENV KIBANA_VERSION 4.3.1
ENV KIBANA_DIR /opt/kibana/
ENV KIBANA_ARCHIVE kibana-${KIBANA_VERSION}-linux-x64.tar.gz
RUN useradd -r -m --user-group kibana \
&& usermod -a -G kolla kibana
RUN curl "https://download.elastic.co/kibana/kibana/$KIBANA_ARCHIVE" -o $KIBANA_ARCHIVE \
&& mkdir -p $KIBANA_DIR \
&& tar -xz --strip-components=1 -f $KIBANA_ARCHIVE -C $KIBANA_DIR \
&& chown -R kibana:kibana $KIBANA_DIR \
&& rm -f $KIBANA_ARCHIVE
{{ include_footer }}
USER kibana