Merge "Add option for HAProxy (non-HA) container to log to stdout/stderr"

This commit is contained in:
Zuul 2017-11-21 01:21:24 +00:00 committed by Gerrit Code Review
commit 2fc41438ec
5 changed files with 136 additions and 65 deletions

View File

@ -107,6 +107,9 @@ resources:
RoleName: {get_param: RoleName} RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters} RoleParameters: {get_param: RoleParameters}
HAProxyLogging:
type: OS::TripleO::Services::Logging::HAProxy
outputs: outputs:
role_data: role_data:
description: Role data for the HAproxy role. description: Role data for the HAproxy role.
@ -115,6 +118,7 @@ outputs:
config_settings: config_settings:
map_merge: map_merge:
- get_attr: [HAProxyBase, role_data, config_settings] - get_attr: [HAProxyBase, role_data, config_settings]
- get_attr: [HAProxyLogging, config_settings]
- tripleo::haproxy::haproxy_service_manage: false - tripleo::haproxy::haproxy_service_manage: false
# NOTE(jaosorior): We disable the CRL since we have no way to restart haproxy # NOTE(jaosorior): We disable the CRL since we have no way to restart haproxy
# when this is updated # when this is updated
@ -169,7 +173,10 @@ outputs:
optional: true optional: true
docker_config: docker_config:
step_1: step_1:
haproxy_firewall: map_merge:
- get_attr: [HAProxyLogging, docker_config, step_1]
- haproxy_firewall:
start_order: 0
detach: false detach: false
image: {get_param: DockerHAProxyImage} image: {get_param: DockerHAProxyImage}
net: host net: host
@ -205,12 +212,14 @@ outputs:
environment: environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
haproxy: haproxy:
start_order: 1
image: {get_param: DockerHAProxyImage} image: {get_param: DockerHAProxyImage}
net: host net: host
restart: always restart: always
volumes: volumes:
list_concat: list_concat:
- {get_attr: [ContainersCommon, volumes]} - {get_attr: [ContainersCommon, volumes]}
- {get_attr: [HAProxyLogging, volumes]}
- -
- /var/lib/kolla/config_files/haproxy.json:/var/lib/kolla/config_files/config.json:ro - /var/lib/kolla/config_files/haproxy.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/haproxy/:/var/lib/kolla/config_files/src:ro - /var/lib/config-data/puppet-generated/haproxy/:/var/lib/kolla/config_files/src:ro

View File

@ -0,0 +1,23 @@
heat_template_version: pike
description: >
OpenStack containerized HAProxy API service
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.
# NOTE(jaosorior): Currently all containers mount /dev/log. Once we
# have a more complete proportion of containers using the pluggable
# interface. we'll remove that and mount it explicitly here.
# - /dev/log:/dev/log
value: null
docker_config:
description: Extra containers needed for logging to files in the host.
value:
step_1: {}
host_prep_tasks:
description: Extra ansible tasks needed for logging to files in the host.
value: null

View File

@ -0,0 +1,37 @@
heat_template_version: pike
description: >
OpenStack containerized HAProxy API service
parameters:
DockerRsyslogSidecarImage:
description: image
type: string
outputs:
config_settings:
description: Extra hieradata needed to log to stdout.
value:
tripleo::haproxy::haproxy_log_address: '/sockets/log'
docker_config:
description: Extra containers needed for logging to stdout or a sidecar container.
value:
step_1:
haproxy_logs:
start_order: 0
image: {get_param: DockerRsyslogSidecarImage}
user: root
restart: always
volumes:
- /var/lib/kolla/config_files/rsyslog_sidecar.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/rsyslog_sidecar/:/var/lib/kolla/config_files/src:ro
- HAProxyLogs:/sockets/
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
volumes:
description: The volumes needed to log to stdout or a sidecar container.
value:
- HAProxyLogs:/sockets/
host_prep_tasks:
description: Extra ansible tasks needed for logging to files in the host.
value: null

View File

@ -2,6 +2,7 @@ resource_registry:
OS::TripleO::Services::RsyslogSidecar: ../docker/services/rsyslog-sidecar.yaml OS::TripleO::Services::RsyslogSidecar: ../docker/services/rsyslog-sidecar.yaml
OS::TripleO::Services::Logging::GlanceApi: ../docker/services/logging/stdout/glance-api.yaml OS::TripleO::Services::Logging::GlanceApi: ../docker/services/logging/stdout/glance-api.yaml
OS::TripleO::Services::Logging::HAProxy: ../docker/services/logging/stdout/haproxy.yaml
OS::TripleO::Services::Logging::HeatApi: ../docker/services/logging/stdout/heat-api.yaml OS::TripleO::Services::Logging::HeatApi: ../docker/services/logging/stdout/heat-api.yaml
OS::TripleO::Services::Logging::HeatApiCfn: ../docker/services/logging/stdout/heat-api-cfn.yaml OS::TripleO::Services::Logging::HeatApiCfn: ../docker/services/logging/stdout/heat-api-cfn.yaml
OS::TripleO::Services::Logging::HeatEngine: ../docker/services/logging/stdout/heat-engine.yaml OS::TripleO::Services::Logging::HeatEngine: ../docker/services/logging/stdout/heat-engine.yaml

View File

@ -305,6 +305,7 @@ resource_registry:
# Logging # Logging
OS::TripleO::Services::Logging::GlanceApi: docker/services/logging/files/glance-api.yaml OS::TripleO::Services::Logging::GlanceApi: docker/services/logging/files/glance-api.yaml
OS::TripleO::Services::Logging::HAProxy: docker/services/logging/files/haproxy.yaml
OS::TripleO::Services::Logging::HeatApi: docker/services/logging/files/heat-api.yaml OS::TripleO::Services::Logging::HeatApi: docker/services/logging/files/heat-api.yaml
OS::TripleO::Services::Logging::HeatApiCfn: docker/services/logging/files/heat-api-cfn.yaml OS::TripleO::Services::Logging::HeatApiCfn: docker/services/logging/files/heat-api-cfn.yaml
OS::TripleO::Services::Logging::HeatEngine: docker/services/logging/files/heat-engine.yaml OS::TripleO::Services::Logging::HeatEngine: docker/services/logging/files/heat-engine.yaml