Enable openvswitch container logs in host volumes

Allow heka container to pick up the openvswitch logs like other
services

Change-Id: I396ae9419540070c6ab01b8f62607ab46b1f08aa
closes-Bug: #1573199
This commit is contained in:
Hui Kang 2016-06-26 23:45:33 -04:00
parent d87b4f63a2
commit 54919dc498
7 changed files with 23 additions and 6 deletions

View File

@ -9,6 +9,7 @@
- "{{ node_config_directory }}/openvswitch-db-server/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/openvswitch-db-server/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
- "/run:/run" - "/run:/run"
- "kolla_logs:/var/log/kolla/"
- "openvswitch_db:/var/lib/openvswitch/" - "openvswitch_db:/var/lib/openvswitch/"
when: when:
- (inventory_hostname in groups['compute'] - (inventory_hostname in groups['compute']
@ -57,6 +58,7 @@
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
- "/lib/modules:/lib/modules:ro" - "/lib/modules:/lib/modules:ro"
- "/run:/run" - "/run:/run"
- "kolla_logs:/var/log/kolla/"
when: when:
- (inventory_hostname in groups['compute'] - (inventory_hostname in groups['compute']
or (enable_manila | bool and inventory_hostname in groups['manila-share']) or (enable_manila | bool and inventory_hostname in groups['manila-share'])

View File

@ -1,4 +1,4 @@
{ {
"command": "/usr/sbin/ovsdb-server /etc/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/run/openvswitch/db.sock --log-file=/var/log/openvswitch/ovsdb-server.log", "command": "/usr/sbin/ovsdb-server /etc/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/run/openvswitch/db.sock --log-file=/var/log/kolla/openvswitch/ovsdb-server.log",
"config_files": [] "config_files": []
} }

View File

@ -1,4 +1,4 @@
{ {
"command": "/usr/sbin/ovs-vswitchd unix:/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file=/var/log/openvswitch/ovs-vswitchd.log", "command": "/usr/sbin/ovs-vswitchd unix:/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file=/var/log/kolla/openvswitch/ovs-vswitchd.log",
"config_files": [] "config_files": []
} }

View File

@ -14,3 +14,8 @@ RUN apt-get install -y --no-install-recommends \
&& apt-get clean && apt-get clean
{% endif %} {% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN touch /usr/local/bin/kolla_openvswitch_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_openvswitch_extend_start

View File

@ -0,0 +1,10 @@
#!/bin/bash
if [[ ! -d "/var/log/kolla/openvswitch" ]]; then
mkdir -p /var/log/kolla/openvswitch
fi
if [[ $(stat -c %a /var/log/kolla/openvswitch) != "755" ]]; then
chmod 755 /var/log/kolla/openvswitch
fi
source /usr/local/bin/kolla_openvswitch_extend_start

View File

@ -2,7 +2,7 @@ FROM {{ namespace }}/{{ image_prefix }}openvswitch-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
COPY ovs_ensure_configured.sh /usr/local/bin/kolla_ensure_openvswitch_configured COPY ovs_ensure_configured.sh /usr/local/bin/kolla_ensure_openvswitch_configured
COPY extend_start.sh /usr/local/bin/kolla_extend_start COPY extend_start.sh /usr/local/bin/kolla_openvswitch_extend_start
RUN chmod 755 /usr/local/bin/kolla_ensure_openvswitch_configured /usr/local/bin/kolla_extend_start RUN chmod 755 /usr/local/bin/kolla_ensure_openvswitch_configured /usr/local/bin/kolla_openvswitch_extend_start
{{ include_footer }} {{ include_footer }}

View File

@ -1,7 +1,7 @@
FROM {{ namespace }}/{{ image_prefix }}openvswitch-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}openvswitch-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
COPY extend_start.sh /usr/local/bin/kolla_extend_start COPY extend_start.sh /usr/local/bin/kolla_openvswitch_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start RUN chmod 755 /usr/local/bin/kolla_openvswitch_extend_start
{{ include_footer }} {{ include_footer }}