This adds the option to get the nova containers to log to stdout. The option is disabled by default. If enabled, for nova-api and placement it also adds a sidecar container that reads the apache access logs. bp logging-stdout-rsyslog Depends-On: I59d02fe8731c20c64ca389000f12c78cfc1f12be Change-Id: I8137d61f2d4352d4d8055e93a30511cf1aeaa6b0changes/57/509157/24
parent
f037da0f36
commit
1e854d613d
@ -0,0 +1,40 @@
|
||||
heat_template_version: pike
|
||||
|
||||
description: >
|
||||
Template for nova-api's logging to files
|
||||
|
||||
parameters:
|
||||
DockerNovaApiImage:
|
||||
description: image
|
||||
type: string
|
||||
|
||||
outputs:
|
||||
config_settings:
|
||||
description: Extra hieradata needed to log to files in the host.
|
||||
value: null
|
||||
volumes:
|
||||
description: The volumes needed to log to files in the host.
|
||||
value: &nova_api_volumes
|
||||
- /var/log/containers/nova:/var/log/nova
|
||||
- /var/log/containers/httpd/nova-api:/var/log/httpd
|
||||
docker_config:
|
||||
description: Extra containers needed for logging to files in the host.
|
||||
value:
|
||||
step_2:
|
||||
# db sync runs before permissions set by kolla_config
|
||||
nova_api_init_logs:
|
||||
image: {get_param: DockerNovaApiImage}
|
||||
privileged: false
|
||||
user: root
|
||||
volumes: *nova_api_volumes
|
||||
command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova']
|
||||
host_prep_tasks:
|
||||
description: Extra ansible tasks needed for logging to files in the host.
|
||||
value:
|
||||
- name: create persistent logs directory
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- /var/log/containers/nova
|
||||
- /var/log/containers/httpd/nova-api
|
@ -0,0 +1,57 @@
|
||||
heat_template_version: pike
|
||||
|
||||
description: >
|
||||
Template for nova's logging to files
|
||||
|
||||
parameters:
|
||||
DockerNovaImage:
|
||||
description: image
|
||||
type: string
|
||||
NovaServiceName:
|
||||
description: service name
|
||||
type: string
|
||||
|
||||
resources:
|
||||
|
||||
InitLogContainerName:
|
||||
type: OS::Heat::Value
|
||||
properties:
|
||||
type: string
|
||||
value:
|
||||
str_replace:
|
||||
template: nova_SERVICE_init_log
|
||||
params:
|
||||
SERVICE: {get_param: NovaServiceName}
|
||||
|
||||
outputs:
|
||||
cmd_extra_args:
|
||||
description: Extra command line arguments for running the service in the container.
|
||||
value: ''
|
||||
config_settings:
|
||||
description: Extra hieradata needed to log to files in the host.
|
||||
value: null
|
||||
volumes:
|
||||
description: The volumes needed to log to files in the host.
|
||||
value:
|
||||
- /var/log/containers/nova:/var/log/nova
|
||||
docker_config:
|
||||
description: Extra containers needed for logging to files in the host.
|
||||
value:
|
||||
step_2:
|
||||
map_replace:
|
||||
- CONTAINERNAME:
|
||||
image: {get_param: DockerNovaImage}
|
||||
privileged: false
|
||||
user: root
|
||||
volumes:
|
||||
- /var/log/containers/nova:/var/log/nova
|
||||
command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova']
|
||||
- keys:
|
||||
CONTAINERNAME: {get_attr: [InitLogContainerName, value]}
|
||||
host_prep_tasks:
|
||||
description: Extra ansible tasks needed for logging to files in the host.
|
||||
value:
|
||||
- name: create persistent logs directory
|
||||
file:
|
||||
path: /var/log/containers/nova
|
||||
state: directory
|
@ -0,0 +1,39 @@
|
||||
heat_template_version: pike
|
||||
|
||||
description: >
|
||||
Template for nova-placement's logging to files
|
||||
|
||||
parameters:
|
||||
DockerNovaPlacementImage:
|
||||
description: image
|
||||
type: string
|
||||
|
||||
outputs:
|
||||
config_settings:
|
||||
description: Extra hieradata needed to log to files in the host.
|
||||
value: null
|
||||
volumes:
|
||||
description: The volumes needed to log to files in the host.
|
||||
value: &nova_placement_volumes
|
||||
- /var/log/containers/nova:/var/log/nova
|
||||
- /var/log/containers/httpd/nova-placement:/var/log/httpd
|
||||
docker_config:
|
||||
description: Extra containers needed for logging to files in the host.
|
||||
value:
|
||||
step_2:
|
||||
nova_placement_init_log:
|
||||
start_order: 1
|
||||
image: {get_param: DockerNovaPlacementImage}
|
||||
user: root
|
||||
command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova']
|
||||
volumes: *nova_placement_volumes
|
||||
host_prep_tasks:
|
||||
description: Extra ansible tasks needed for logging to files in the host.
|
||||
value:
|
||||
- name: create persistent logs directory
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- /var/log/containers/nova
|
||||
- /var/log/containers/httpd/nova-placement
|
@ -0,0 +1,60 @@
|
||||
heat_template_version: pike
|
||||
|
||||
description: >
|
||||
Template for nova-api's logging to stdout
|
||||
|
||||
parameters:
|
||||
DockerNovaApiImage:
|
||||
description: image
|
||||
type: string
|
||||
|
||||
outputs:
|
||||
config_settings:
|
||||
description: Extra hieradata needed to log to stdout.
|
||||
value:
|
||||
nova::wsgi::apache_api::access_log_file: /var/log/httpd/access.log
|
||||
nova::wsgi::apache_api::error_log_file: /var/log/httpd/error_log
|
||||
volumes:
|
||||
description: The volumes needed to log to stdout or a sidecar container.
|
||||
value:
|
||||
- NovaApiLogs:/var/log/
|
||||
docker_config:
|
||||
description: Extra containers needed for logging to stdout or a sidecar container.
|
||||
value:
|
||||
step_2:
|
||||
nova_api_apache_error_logs:
|
||||
start_order: 1
|
||||
image: {get_param: DockerNovaApiImage}
|
||||
user: root
|
||||
privileged: false
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: '[ -p /var/log/httpd/error_log ]'
|
||||
command: ['/bin/bash', '-c', 'mkdir -p /var/log/httpd && rm -f /var/log/httpd/error_log && mkfifo /var/log/httpd/error_log && while true; do cat /var/log/httpd/error_log; done']
|
||||
volumes:
|
||||
- NovaApiLogs:/var/log/
|
||||
nova_api_apache_access_logs:
|
||||
start_order: 1
|
||||
image: {get_param: DockerNovaApiImage}
|
||||
user: root
|
||||
privileged: false
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: '[ -p /var/log/httpd/access.log ]'
|
||||
command: ['/bin/bash', '-c', 'mkdir -p /var/log/httpd && rm -f /var/log/httpd/access.log && mkfifo /var/log/httpd/access.log && while true; do cat /var/log/httpd/access.log; done']
|
||||
volumes:
|
||||
- NovaApiLogs:/var/log/
|
||||
nova_api_logs:
|
||||
start_order: 2
|
||||
image: {get_param: DockerNovaApiImage}
|
||||
user: nova
|
||||
privileged: false
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: '[ -p /var/log/nova/nova-api.log ]'
|
||||
command: ['/bin/bash', '-c', 'mkdir -p /var/log/nova && rm -f /var/log/nova/nova-api.log && mkfifo /var/log/nova/nova-api.log && while true; do cat /var/log/nova/nova-api.log; done']
|
||||
volumes:
|
||||
- NovaApiLogs:/var/log/
|
||||
host_prep_tasks:
|
||||
description: Extra ansible tasks needed for logging to files in the host.
|
||||
value: null
|
@ -0,0 +1,30 @@
|
||||
heat_template_version: pike
|
||||
|
||||
description: >
|
||||
Template for nova's logging to stdout
|
||||
|
||||
parameters:
|
||||
DockerNovaImage:
|
||||
description: image
|
||||
type: string
|
||||
NovaServiceName:
|
||||
description: service name
|
||||
type: string
|
||||
|
||||
outputs:
|
||||
cmd_extra_args:
|
||||
description: Extra command line arguments for running the service in the container.
|
||||
value: "--log-dir= --log-file="
|
||||
config_settings:
|
||||
description: Extra hieradata needed to log to stdout.
|
||||
value: null
|
||||
volumes:
|
||||
description: The volumes needed to log to stdout.
|
||||
value: null
|
||||
docker_config:
|
||||
description: Extra containers needed for logging to stdout.
|
||||
value:
|
||||
step_2: {}
|
||||
host_prep_tasks:
|
||||
description: Extra ansible tasks needed for logging to stdout.
|
||||
value: null
|
@ -0,0 +1,60 @@
|
||||
heat_template_version: pike
|
||||
|
||||
description: >
|
||||
Template for nova-placement's logging to stdout
|
||||
|
||||
parameters:
|
||||
DockerNovaPlacementImage:
|
||||
description: image
|
||||
type: string
|
||||
|
||||
outputs:
|
||||
config_settings:
|
||||
description: Extra hieradata needed to log to stdout.
|
||||
value:
|
||||
nova::wsgi::apache_placement::access_log_file: /var/log/httpd/access.log
|
||||
nova::wsgi::apache_placement::error_log_file: /var/log/httpd/error_log
|
||||
volumes:
|
||||
description: The volumes needed to log to stdout or a sidecar container.
|
||||
value:
|
||||
- NovaPlacementLogs:/var/log/
|
||||
docker_config:
|
||||
description: Extra containers needed for logging to stdout or a sidecar container.
|
||||
value:
|
||||
step_2:
|
||||
nova_placement_apache_error_logs:
|
||||
start_order: 1
|
||||
image: {get_param: DockerNovaPlacementImage}
|
||||
user: root
|
||||
privileged: false
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: '[ -p /var/log/httpd/error_log ]'
|
||||
command: ['/bin/bash', '-c', 'mkdir -p /var/log/httpd && rm -f /var/log/httpd/error_log && mkfifo /var/log/httpd/error_log && while true; do cat /var/log/httpd/error_log; done']
|
||||
volumes:
|
||||
- NovaPlacementLogs:/var/log/
|
||||
nova_placement_apache_access_logs:
|
||||
start_order: 1
|
||||
image: {get_param: DockerNovaPlacementImage}
|
||||
user: root
|
||||
privileged: false
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: '[ -p /var/log/httpd/access.log ]'
|
||||
command: ['/bin/bash', '-c', 'mkdir -p /var/log/httpd && rm -f /var/log/httpd/access.log && mkfifo /var/log/httpd/access.log && while true; do cat /var/log/httpd/access.log; done']
|
||||
volumes:
|
||||
- NovaPlacementLogs:/var/log/
|
||||
nova_placement_logs:
|
||||
start_order: 2
|
||||
image: {get_param: DockerNovaPlacementImage}
|
||||
user: nova
|
||||
privileged: false
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: '[ -p /var/log/nova/nova-placement-api.log ]'
|
||||
command: ['/bin/bash', '-c', 'mkdir -p /var/log/nova && rm -f /var/log/nova/nova-placement-api.log && mkfifo /var/log/nova/nova-placement-api.log && while true; do cat /var/log/nova/nova-placement-api.log; done']
|
||||
volumes:
|
||||
- NovaPlacementLogs:/var/log/
|
||||
host_prep_tasks:
|
||||
description: Extra ansible tasks needed for logging to files in the host.
|
||||
value: null
|
Loading…
Reference in new issue