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:
parent
0de0511e3b
commit
3672152d9d
@ -122,6 +122,9 @@ rgw_port: "6780"
|
|||||||
|
|
||||||
mistral_api_port: "8989"
|
mistral_api_port: "8989"
|
||||||
|
|
||||||
|
kibana_port: "5601"
|
||||||
|
elasticsearch_port: "9200"
|
||||||
|
|
||||||
####################
|
####################
|
||||||
# Openstack options
|
# Openstack options
|
||||||
####################
|
####################
|
||||||
@ -174,7 +177,7 @@ enable_murano: "no"
|
|||||||
enable_ironic: "no"
|
enable_ironic: "no"
|
||||||
enable_magnum: "no"
|
enable_magnum: "no"
|
||||||
enable_mistral: "no"
|
enable_mistral: "no"
|
||||||
|
enable_elk: "no"
|
||||||
ironic_keystone_user: "ironic"
|
ironic_keystone_user: "ironic"
|
||||||
|
|
||||||
# Nova fake driver and the number of fake driver per compute node
|
# Nova fake driver and the number of fake driver per compute node
|
||||||
|
@ -15,6 +15,9 @@ localhost ansible_connection=local
|
|||||||
|
|
||||||
# You can explicitly specify which hosts run each project by updating the
|
# You can explicitly specify which hosts run each project by updating the
|
||||||
# groups in the sections below. Common services are grouped together.
|
# groups in the sections below. Common services are grouped together.
|
||||||
|
[kibana:children]
|
||||||
|
control
|
||||||
|
|
||||||
[haproxy:children]
|
[haproxy:children]
|
||||||
network
|
network
|
||||||
|
|
||||||
|
@ -27,6 +27,9 @@ storage01
|
|||||||
|
|
||||||
# You can explicitly specify which hosts run each project by updating the
|
# You can explicitly specify which hosts run each project by updating the
|
||||||
# groups in the sections below. Common services are grouped together.
|
# groups in the sections below. Common services are grouped together.
|
||||||
|
[kibana:children]
|
||||||
|
control
|
||||||
|
|
||||||
[haproxy:children]
|
[haproxy:children]
|
||||||
network
|
network
|
||||||
|
|
||||||
|
24
ansible/roles/kibana/defaults/main.yml
Normal file
24
ansible/roles/kibana/defaults/main.yml
Normal 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"
|
3
ansible/roles/kibana/meta/main.yml
Normal file
3
ansible/roles/kibana/meta/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
dependencies:
|
||||||
|
- { role: common }
|
22
ansible/roles/kibana/tasks/config.yml
Normal file
22
ansible/roles/kibana/tasks/config.yml
Normal 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"
|
4
ansible/roles/kibana/tasks/deploy.yml
Normal file
4
ansible/roles/kibana/tasks/deploy.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
- include: config.yml
|
||||||
|
|
||||||
|
- include: start.yml
|
2
ansible/roles/kibana/tasks/main.yml
Normal file
2
ansible/roles/kibana/tasks/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- include: "{{ action }}.yml"
|
5
ansible/roles/kibana/tasks/pull.yml
Normal file
5
ansible/roles/kibana/tasks/pull.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
- name: Pulling Kibana image
|
||||||
|
kolla_docker:
|
||||||
|
action: "pull_image"
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
image: "{{ kibana_image_full }}"
|
9
ansible/roles/kibana/tasks/start.yml
Normal file
9
ansible/roles/kibana/tasks/start.yml
Normal 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"
|
11
ansible/roles/kibana/templates/kibana.json.j2
Normal file
11
ansible/roles/kibana/templates/kibana.json.j2
Normal 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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
19
ansible/roles/kibana/templates/kibana.yml.j2
Normal file
19
ansible/roles/kibana/templates/kibana.yml.j2
Normal 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
|
@ -26,6 +26,12 @@
|
|||||||
tags: haproxy,
|
tags: haproxy,
|
||||||
when: enable_haproxy | bool }
|
when: enable_haproxy | bool }
|
||||||
|
|
||||||
|
- hosts: kibana
|
||||||
|
roles:
|
||||||
|
- { role: kibana,
|
||||||
|
tags: kibana,
|
||||||
|
when: enable_elk | bool }
|
||||||
|
|
||||||
- hosts: memcached
|
- hosts: memcached
|
||||||
roles:
|
roles:
|
||||||
- { role: memcached,
|
- { role: memcached,
|
||||||
|
19
docker/kibana/Dockerfile.j2
Normal file
19
docker/kibana/Dockerfile.j2
Normal 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
|
Loading…
Reference in New Issue
Block a user