Use RpcPort for container healthchecks

Update healthcheck commands that probe oslo's messaging port to use the
RpcPort parameter. Previously, some templates referenced the service's
own 'rabbit_port' config setting, which led to malformed healthcheck
commands when the 'rabbit_port' settings were deprecated.

Update the templates that looked up the port in the RabbitMQService's
global_config_settings. Not only did this break the oslo abstraction
by referring to a specific messaging backend (rabbit), it broke
split-stack deployments in which the RabbitMQService is not actually
deployed on the secondary stack's nodes.

This patch creates a common healthcheck command using the RpcPort
parameter in containers-common.yaml. This allows other templates to
reference a common healthcheck command. Other templates that should
also use this can be cleaned up in a separate patch.

Closes-Bug: #1825342
Change-Id: I0d3974089ae6e6879adab4852715c7a1c1188f7c
This commit is contained in:
Alan Bishop 2019-05-09 09:25:58 -04:00
parent 5834f17f4b
commit c5fe51147b
13 changed files with 26 additions and 152 deletions

View File

@ -97,15 +97,7 @@ outputs:
net: host
privileged: false
restart: always
healthcheck:
test:
list_join:
- ' '
- - '/openstack/healthcheck'
- yaql:
expression: str($.data.port)
data:
port: {get_attr: [AodhBase, role_data, config_settings, 'aodh::rabbit_port']}
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}

View File

@ -97,15 +97,7 @@ outputs:
net: host
privileged: false
restart: always
healthcheck:
test:
list_join:
- ' '
- - '/openstack/healthcheck'
- yaql:
expression: str($.data.port)
data:
port: {get_attr: [AodhBase, role_data, config_settings, 'aodh::rabbit_port']}
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}

View File

@ -199,15 +199,7 @@ outputs:
net: host
privileged: true
restart: always
healthcheck:
test:
list_join:
- ' '
- - '/openstack/healthcheck'
- yaql:
expression: str($.data.port)
data:
port: {get_attr: [CinderBase, role_data, config_settings, 'cinder::rabbit_port']}
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes: {get_attr: [CinderCommon, cinder_backup_volumes]}
environment: {get_attr: [CinderCommon, cinder_backup_environment]}
host_prep_tasks:

View File

@ -120,15 +120,7 @@ outputs:
net: host
privileged: false
restart: always
healthcheck:
test:
list_join:
- ' '
- - '/openstack/healthcheck'
- yaql:
expression: str($.data.port)
data:
port: {get_attr: [CinderBase, role_data, config_settings, 'cinder::rabbit_port']}
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}

View File

@ -323,15 +323,7 @@ outputs:
net: host
privileged: true
restart: always
healthcheck:
test:
list_join:
- ' '
- - '/openstack/healthcheck'
- yaql:
expression: str($.data.port)
data:
port: {get_attr: [CinderBase, role_data, config_settings, 'cinder::rabbit_port']}
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes: {get_attr: [CinderCommon, cinder_volume_volumes]}
environment: {get_attr: [CinderCommon, cinder_volume_environment]}
host_prep_tasks: {get_attr: [CinderCommon, cinder_volume_host_prep_tasks]}

View File

@ -42,6 +42,10 @@ parameters:
type: string
description: Specifies the default CA cert to use if TLS is used for
services in the internal network.
RpcPort:
default: 5672
description: The network port for messaging backend
type: number
conditions:
@ -128,3 +132,13 @@ outputs:
# container_puppet_apply.sh will copy this to /etc/puppet in the container
- /etc/puppet:/tmp/puppet-etc:ro
- /usr/share/openstack-puppet/modules:/usr/share/openstack-puppet/modules:ro
healthcheck_rpc_port:
description: healthcheck command that probes the RpcPort
value:
test:
str_replace:
template:
'/openstack/healthcheck RPCPORT'
params:
RPCPORT: {get_param: RpcPort}

View File

@ -122,23 +122,12 @@ resources:
HeatEngineLogging:
type: OS::TripleO::Services::Logging::HeatEngine
RabbitMQService:
type: OS::TripleO::Services::OsloMessagingRpc
properties:
ServiceData: {get_param: ServiceData}
ServiceNetMap: {get_param: ServiceNetMap}
DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap}
RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters}
outputs:
role_data:
description: Role data for the Heat Engine role.
value:
service_name: heat_engine
monitoring_subscription: {get_param: MonitoringSubscriptionHeatEngine}
global_config_settings: {get_attr: [RabbitMQService, role_data, global_config_settings]}
config_settings:
map_merge:
- get_attr: [HeatBase, role_data, config_settings]
@ -261,15 +250,7 @@ outputs:
privileged: false
stop_grace_period: 60
restart: always
healthcheck:
test:
list_join:
- ' '
- - '/openstack/healthcheck'
- yaql:
expression: str($.data.port)
data:
port: {get_attr: [RabbitMQService, role_data, global_config_settings, 'oslo_messaging_rpc_port']}
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}

View File

@ -508,15 +508,7 @@ outputs:
net: host
privileged: true
restart: always
healthcheck:
test:
list_join:
- ' '
- - '/openstack/healthcheck'
- yaql:
expression: str($.data.port)
data:
port: {get_attr: [IronicBase, role_data, config_settings, 'ironic::rabbit_port']}
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}

View File

@ -184,15 +184,7 @@ outputs:
pid: host
privileged: true
restart: always
healthcheck:
test:
list_join:
- ' '
- - '/openstack/healthcheck'
- yaql:
expression: str($.data.port)
data:
port: {get_attr: [NeutronBase, role_data, config_settings, 'neutron::rabbit_port']}
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}

View File

@ -280,16 +280,6 @@ resources:
MySQLClient:
type: ../../deployment/database/mysql-client.yaml
RabbitMQService:
type: OS::TripleO::Services::OsloMessagingRpc
properties:
ServiceData: {get_param: ServiceData}
ServiceNetMap: {get_param: ServiceNetMap}
DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap}
RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters}
NovaComputeCommon:
type: ./nova-compute-common-container-puppet.yaml
properties:
@ -387,7 +377,6 @@ outputs:
value:
service_name: nova_compute
monitoring_subscription: {get_param: MonitoringSubscriptionNovaCompute}
global_config_settings: {get_attr: [RabbitMQService, role_data, global_config_settings]}
config_settings:
map_merge:
- get_attr: [NovaLogging, config_settings]
@ -582,15 +571,7 @@ outputs:
privileged: true
user: nova
restart: always
healthcheck:
test:
list_join:
- ' '
- - '/openstack/healthcheck'
- yaql:
expression: str($.data.port)
data:
port: {get_attr: [RabbitMQService, role_data, global_config_settings, 'oslo_messaging_rpc_port']}
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}

View File

@ -49,16 +49,6 @@ resources:
MySQLClient:
type: ../../deployment/database/mysql-client.yaml
RabbitMQService:
type: OS::TripleO::Services::OsloMessagingRpc
properties:
ServiceData: {get_param: ServiceData}
ServiceNetMap: {get_param: ServiceNetMap}
DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap}
RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters}
NovaComputeCommon:
type: ./nova-compute-common-container-puppet.yaml
properties:
@ -84,7 +74,6 @@ outputs:
description: Role data for the Nova Compute service.
value:
service_name: nova_ironic
global_config_settings: {get_attr: [RabbitMQService, role_data, global_config_settings]}
config_settings:
map_merge:
- get_attr: [NovaBase, role_data, config_settings]
@ -146,15 +135,7 @@ outputs:
privileged: true
user: root
restart: always
healthcheck:
test:
list_join:
- ' '
- - '/openstack/healthcheck'
- yaql:
expression: str($.data.port)
data:
port: {get_attr: [RabbitMQService, role_data, global_config_settings, 'oslo_messaging_rpc_port']}
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}

View File

@ -87,16 +87,6 @@ resources:
MySQLClient:
type: ../../deployment/database/mysql-client.yaml
RabbitMQService:
type: OS::TripleO::Services::OsloMessagingRpc
properties:
ServiceData: {get_param: ServiceData}
ServiceNetMap: {get_param: ServiceNetMap}
DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap}
RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters}
NovaLogging:
type: OS::TripleO::Services::Logging::NovaCommon
properties:
@ -120,7 +110,6 @@ outputs:
value:
service_name: nova_scheduler
monitoring_subscription: {get_param: MonitoringSubscriptionNovaScheduler}
global_config_settings: {get_attr: [RabbitMQService, role_data, global_config_settings]}
config_settings:
map_merge:
- {get_attr: [NovaBase, role_data, config_settings]}
@ -173,15 +162,7 @@ outputs:
net: host
privileged: false
restart: always
healthcheck:
test:
list_join:
- ' '
- - '/openstack/healthcheck'
- yaql:
expression: str($.data.port)
data:
port: {get_attr: [RabbitMQService, role_data, global_config_settings, 'oslo_messaging_rpc_port']}
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}

View File

@ -111,15 +111,7 @@ outputs:
net: host
privileged: false
restart: always
healthcheck:
test:
list_join:
- ' '
- - '/openstack/healthcheck'
- yaql:
expression: str($.data.port)
data:
port: {get_attr: [SaharaBase, role_data, config_settings, 'sahara::rabbit_port']}
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}