Browse Source

Configure log path for kibana

Closes-Bug: #1635989
Change-Id: I99402e54e7cc2f1ad972021bb1056966f5c08bff
changes/80/386980/3
Jeffrey Zhang 5 years ago
committed by Jeffrey Zhang
parent
commit
a5afa45f4e
  1. 1
      ansible/roles/kibana/templates/kibana.yml.j2
  2. 4
      docker/kibana/Dockerfile.j2
  3. 10
      docker/kibana/extend_start.sh

1
ansible/roles/kibana/templates/kibana.yml.j2

@ -1,4 +1,5 @@
kibana.defaultAppId: "{{ kibana_default_app_id }}"
logging.dest: /var/log/kolla/kibana/kibana.log
server.port: {{ kibana_server_port }}
server.host: "{% if orchestration_engine == 'KUBERNETES' %}0.0.0.0{% else %}{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}{% endif %}"
elasticsearch.url: "{{ internal_protocol }}://{% if orchestration_engine == 'KUBERNETES' %}elasticsearch{% else %}{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}{% endif %}:{{ elasticsearch_port }}"

4
docker/kibana/Dockerfile.j2

@ -5,8 +5,10 @@ MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN useradd -r -m --user-group kibana \
&& usermod -a -G kolla kibana
&& usermod -a -G kolla kibana \
&& chmod 755 /usr/local/bin/kolla_extend_start
{% set kibana_packages = ['kibana'] %}
{{ macros.install_packages(kibana_packages | customizable("packages")) }}

10
docker/kibana/extend_start.sh

@ -0,0 +1,10 @@
#!/bin/bash
KIBANA_LOG_DIR="/var/log/kolla/kibana"
if [[ ! -d "${KIBANA_LOG_DIR}" ]]; then
mkdir -p "${KIBANA_LOG_DIR}"
fi
if [[ $(stat -c %U:%G "${KIBANA_LOG_DIR}") != "kibana:kolla" ]]; then
chown kibana:kolla "${KIBANA_LOG_DIR}"
fi
Loading…
Cancel
Save