Add glance-registry to the loadbalancer and cleanup namings
The glance-registry server wasn't configured on the loadbalancers. This can be problematic at some point. Moreover the glance registry server was listening on 0.0.0.0, this should be the public eth. I also cleaned up all glance naming to reflect the difference between glance_api and glance_registry. The glance_registry option has been added to the glance template.
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
# (optional) Internal Hostname or IP to connect to Glance API
|
# (optional) Internal Hostname or IP to connect to Glance API
|
||||||
# Default value in params
|
# Default value in params
|
||||||
#
|
#
|
||||||
# [*glance_port*]
|
# [*glance_api_port*]
|
||||||
# (optional) TCP port to connect to Glance API
|
# (optional) TCP port to connect to Glance API
|
||||||
# Default value in params
|
# Default value in params
|
||||||
#
|
#
|
||||||
@@ -63,7 +63,7 @@ class cloud::compute(
|
|||||||
$rabbit_hosts = $os_params::rabbit_hosts,
|
$rabbit_hosts = $os_params::rabbit_hosts,
|
||||||
$rabbit_password = $os_params::rabbit_password,
|
$rabbit_password = $os_params::rabbit_password,
|
||||||
$ks_glance_internal_host = $os_params::ks_glance_internal_host,
|
$ks_glance_internal_host = $os_params::ks_glance_internal_host,
|
||||||
$glance_port = $os_params::ks_glance_internal_port,
|
$glance_api_port = $os_params::ks_glance_api_internal_port,
|
||||||
$verbose = $os_params::verbose,
|
$verbose = $os_params::verbose,
|
||||||
$debug = $os_params::debug
|
$debug = $os_params::debug
|
||||||
) {
|
) {
|
||||||
@@ -82,7 +82,7 @@ class cloud::compute(
|
|||||||
rabbit_userid => 'nova',
|
rabbit_userid => 'nova',
|
||||||
rabbit_hosts => $rabbit_hosts,
|
rabbit_hosts => $rabbit_hosts,
|
||||||
rabbit_password => $rabbit_password,
|
rabbit_password => $rabbit_password,
|
||||||
glance_api_servers => "http://${ks_glance_internal_host}:${glance_port}",
|
glance_api_servers => "http://${ks_glance_internal_host}:${glance_api_port}",
|
||||||
verbose => $verbose,
|
verbose => $verbose,
|
||||||
debug => $debug
|
debug => $debug
|
||||||
}
|
}
|
||||||
|
@@ -287,11 +287,11 @@
|
|||||||
# (optional) TCP port to connect to Heat API from admin network
|
# (optional) TCP port to connect to Heat API from admin network
|
||||||
# Default value in params
|
# Default value in params
|
||||||
#
|
#
|
||||||
# [*ks_glance_internal_port*]
|
# [*ks_glance_api_internal_port*]
|
||||||
# (optional) TCP port to connect to Glance API from internal network
|
# (optional) TCP port to connect to Glance API from internal network
|
||||||
# Default value in params
|
# Default value in params
|
||||||
#
|
#
|
||||||
# [*ks_glance_public_port*]
|
# [*ks_glance_api_public_port*]
|
||||||
# (optional) TCP port to connect to Glance API from public network
|
# (optional) TCP port to connect to Glance API from public network
|
||||||
# Default value in params
|
# Default value in params
|
||||||
#
|
#
|
||||||
@@ -343,7 +343,7 @@ class cloud::identity (
|
|||||||
$ks_glance_password = $os_params::ks_glance_password,
|
$ks_glance_password = $os_params::ks_glance_password,
|
||||||
$ks_glance_public_host = $os_params::ks_glance_public_host,
|
$ks_glance_public_host = $os_params::ks_glance_public_host,
|
||||||
$ks_glance_public_proto = $os_params::ks_glance_public_proto,
|
$ks_glance_public_proto = $os_params::ks_glance_public_proto,
|
||||||
$ks_glance_public_port = $os_params::ks_glance_public_port,
|
$ks_glance_api_public_port = $os_params::ks_glance_api_public_port,
|
||||||
$ks_heat_admin_host = $os_params::ks_heat_admin_host,
|
$ks_heat_admin_host = $os_params::ks_heat_admin_host,
|
||||||
$ks_heat_internal_host = $os_params::ks_heat_internal_host,
|
$ks_heat_internal_host = $os_params::ks_heat_internal_host,
|
||||||
$ks_heat_password = $os_params::ks_heat_password,
|
$ks_heat_password = $os_params::ks_heat_password,
|
||||||
@@ -502,7 +502,7 @@ class cloud::identity (
|
|||||||
admin_address => $ks_glance_admin_host,
|
admin_address => $ks_glance_admin_host,
|
||||||
internal_address => $ks_glance_internal_host,
|
internal_address => $ks_glance_internal_host,
|
||||||
public_address => $ks_glance_public_host,
|
public_address => $ks_glance_public_host,
|
||||||
port => $ks_glance_public_port,
|
port => $ks_glance_api_public_port,
|
||||||
region => $region,
|
region => $region,
|
||||||
password => $ks_glance_password
|
password => $ks_glance_password
|
||||||
}
|
}
|
||||||
|
@@ -35,10 +35,14 @@
|
|||||||
# (optional) Internal Hostname or IP to connect to Keystone API
|
# (optional) Internal Hostname or IP to connect to Keystone API
|
||||||
# Default value in params
|
# Default value in params
|
||||||
#
|
#
|
||||||
# [*ks_glance_internal_port*]
|
# [*ks_glance_api_internal_port*]
|
||||||
# (optional) TCP port to connect to Glance API from internal network
|
# (optional) TCP port to connect to Glance API from internal network
|
||||||
# Default value in params
|
# Default value in params
|
||||||
#
|
#
|
||||||
|
# [*ks_glance_registry_internal_port*]
|
||||||
|
# (optional) TCP port to connect to Glance Registry from internal network
|
||||||
|
# Default value in params
|
||||||
|
#
|
||||||
# [*ks_glance_password*]
|
# [*ks_glance_password*]
|
||||||
# (optional) Password used by Glance to connect to Keystone API
|
# (optional) Password used by Glance to connect to Keystone API
|
||||||
# Default value in params
|
# Default value in params
|
||||||
@@ -57,25 +61,40 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
class cloud::image(
|
class cloud::image(
|
||||||
$glance_db_host = $os_params::glance_db_host,
|
$glance_db_host = $os_params::glance_db_host,
|
||||||
$glance_db_user = $os_params::glance_db_user,
|
$glance_db_user = $os_params::glance_db_user,
|
||||||
$glance_db_password = $os_params::glance_db_password,
|
$glance_db_password = $os_params::glance_db_password,
|
||||||
$ks_keystone_internal_host = $os_params::ks_keystone_internal_host,
|
$ks_keystone_internal_host = $os_params::ks_keystone_internal_host,
|
||||||
$ks_glance_internal_port = $os_params::ks_glance_internal_port,
|
$ks_glance_api_internal_port = $os_params::ks_glance_api_internal_port,
|
||||||
$ks_glance_password = $os_params::ks_glance_password,
|
$ks_glance_registry_internal_port = $os_params::ks_glance_registry_internal_port,
|
||||||
$rabbit_password = $os_params::rabbit_password,
|
$ks_glance_password = $os_params::ks_glance_password,
|
||||||
$rabbit_host = $os_params::rabbit_hosts[0],
|
$rabbit_password = $os_params::rabbit_password,
|
||||||
$api_eth = $os_params::api_eth,
|
$rabbit_host = $os_params::rabbit_hosts[0],
|
||||||
$rbd_store_pool = $os_params::glance_rbd_pool,
|
$api_eth = $os_params::api_eth,
|
||||||
$rbd_store_user = $os_params::glance_rbd_user,
|
$rbd_store_pool = $os_params::glance_rbd_pool,
|
||||||
$verbose = $os_params::verbose,
|
$rbd_store_user = $os_params::glance_rbd_user,
|
||||||
$debug = $os_params::debug
|
$verbose = $os_params::verbose,
|
||||||
|
$debug = $os_params::debug
|
||||||
) {
|
) {
|
||||||
|
|
||||||
$encoded_glance_user = uriescape($glance_db_user)
|
$encoded_glance_user = uriescape($glance_db_user)
|
||||||
$encoded_glance_password = uriescape($glance_db_password)
|
$encoded_glance_password = uriescape($glance_db_password)
|
||||||
|
|
||||||
class { ['glance::api', 'glance::registry']:
|
class { 'glance::api':
|
||||||
|
sql_connection => "mysql://${encoded_glance_user}:${encoded_glance_password}@${glance_db_host}/glance",
|
||||||
|
registry_host => $ks_glance_internal_host,
|
||||||
|
verbose => $verbose,
|
||||||
|
debug => $debug,
|
||||||
|
auth_host => $ks_keystone_internal_host,
|
||||||
|
keystone_password => $ks_glance_password,
|
||||||
|
keystone_tenant => 'services',
|
||||||
|
keystone_user => 'glance',
|
||||||
|
log_facility => 'LOG_LOCAL0',
|
||||||
|
bind_host => $api_eth,
|
||||||
|
use_syslog => true
|
||||||
|
}
|
||||||
|
|
||||||
|
class { 'glance::registry':
|
||||||
sql_connection => "mysql://${encoded_glance_user}:${encoded_glance_password}@${glance_db_host}/glance",
|
sql_connection => "mysql://${encoded_glance_user}:${encoded_glance_password}@${glance_db_host}/glance",
|
||||||
verbose => $verbose,
|
verbose => $verbose,
|
||||||
debug => $debug,
|
debug => $debug,
|
||||||
@@ -103,11 +122,19 @@ class cloud::image(
|
|||||||
class { 'glance::cache::pruner': }
|
class { 'glance::cache::pruner': }
|
||||||
|
|
||||||
# TODO(EmilienM) For later, I'll also add internal network support in HAproxy for all OpenStack API, to optimize North / South network traffic
|
# TODO(EmilienM) For later, I'll also add internal network support in HAproxy for all OpenStack API, to optimize North / South network traffic
|
||||||
@@haproxy::balancermember{"${::fqdn}-public_api":
|
@@haproxy::balancermember{"${::fqdn}-glance_api":
|
||||||
listening_service => 'glance_api_cluster',
|
listening_service => 'glance_api_cluster',
|
||||||
server_names => $::hostname,
|
server_names => $::hostname,
|
||||||
ipaddresses => $api_eth,
|
ipaddresses => $api_eth,
|
||||||
ports => $ks_glance_internal_port,
|
ports => $ks_glance_api_internal_port,
|
||||||
|
options => 'check inter 2000 rise 2 fall 5'
|
||||||
|
}
|
||||||
|
|
||||||
|
@@haproxy::balancermember{"${::fqdn}-glance_registry":
|
||||||
|
listening_service => 'glance_registry_cluster',
|
||||||
|
server_names => $::hostname,
|
||||||
|
ipaddresses => $api_eth,
|
||||||
|
ports => $ks_glance_registry_internal_port,
|
||||||
options => 'check inter 2000 rise 2 fall 5'
|
options => 'check inter 2000 rise 2 fall 5'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,44 +16,46 @@
|
|||||||
# HAproxy nodes
|
# HAproxy nodes
|
||||||
#
|
#
|
||||||
class cloud::loadbalancer(
|
class cloud::loadbalancer(
|
||||||
$ceilometer_api = true,
|
$ceilometer_api = true,
|
||||||
$cinder_api = true,
|
$cinder_api = true,
|
||||||
$glance_api = true,
|
$glance_api = true,
|
||||||
$neutron_api = true,
|
$glance_registry = true,
|
||||||
$heat_api = true,
|
$neutron_api = true,
|
||||||
$heat_cfn_api = true,
|
$heat_api = true,
|
||||||
$heat_cloudwatch_api = true,
|
$heat_cfn_api = true,
|
||||||
$nova_api = true,
|
$heat_cloudwatch_api = true,
|
||||||
$ec2_api = true,
|
$nova_api = true,
|
||||||
$metadata_api = true,
|
$ec2_api = true,
|
||||||
$swift_api = true,
|
$metadata_api = true,
|
||||||
$keystone_api_admin = true,
|
$swift_api = true,
|
||||||
$keystone_api = true,
|
$keystone_api_admin = true,
|
||||||
$horizon = true,
|
$keystone_api = true,
|
||||||
$spice = true,
|
$horizon = true,
|
||||||
$haproxy_auth = $os_params::haproxy_auth,
|
$spice = true,
|
||||||
$keepalived_state = 'BACKUP',
|
$haproxy_auth = $os_params::haproxy_auth,
|
||||||
$keepalived_priority = 50,
|
$keepalived_state = 'BACKUP',
|
||||||
$keepalived_interface = $os_params::keepalived_interface,
|
$keepalived_priority = 50,
|
||||||
$keepalived_ipvs = [$os_params::vip_public_ip,$os_params::galera_ip],
|
$keepalived_interface = $os_params::keepalived_interface,
|
||||||
$keepalived_localhost_ip = $os_params::keepalived_localhost_ip,
|
$keepalived_ipvs = [$os_params::vip_public_ip,$os_params::galera_ip],
|
||||||
$ks_cinder_public_port = $os_params::ks_cinder_public_port,
|
$keepalived_localhost_ip = $os_params::keepalived_localhost_ip,
|
||||||
$ks_ceilometer_public_port = $os_params::ks_ceilometer_public_port,
|
$ks_cinder_public_port = $os_params::ks_cinder_public_port,
|
||||||
$ks_ec2_public_port = $os_params::ks_ec2_public_port,
|
$ks_ceilometer_public_port = $os_params::ks_ceilometer_public_port,
|
||||||
$ks_glance_public_port = $os_params::ks_glance_public_port,
|
$ks_ec2_public_port = $os_params::ks_ec2_public_port,
|
||||||
$ks_heat_public_port = $os_params::ks_heat_public_port,
|
$ks_glance_api_public_port = $os_params::ks_glance_api_public_port,
|
||||||
$ks_heat_cfn_public_port = $os_params::ks_heat_cfn_public_port,
|
$ks_glance_registry_internal_port = $os_params::ks_glance_registry_internal_port,
|
||||||
$ks_heat_cloudwatch_public_port = $os_params::ks_heat_cloudwatch_public_port,
|
$ks_heat_public_port = $os_params::ks_heat_public_port,
|
||||||
$ks_keystone_admin_port = $os_params::ks_keystone_admin_port,
|
$ks_heat_cfn_public_port = $os_params::ks_heat_cfn_public_port,
|
||||||
$ks_keystone_public_port = $os_params::ks_keystone_public_port,
|
$ks_heat_cloudwatch_public_port = $os_params::ks_heat_cloudwatch_public_port,
|
||||||
$ks_metadata_public_port = $os_params::ks_metadata_public_port,
|
$ks_keystone_admin_port = $os_params::ks_keystone_admin_port,
|
||||||
$ks_neutron_public_port = $os_params::ks_neutron_public_port,
|
$ks_keystone_public_port = $os_params::ks_keystone_public_port,
|
||||||
$ks_nova_public_port = $os_params::ks_nova_public_port,
|
$ks_metadata_public_port = $os_params::ks_metadata_public_port,
|
||||||
$ks_swift_public_port = $os_params::ks_swift_public_port,
|
$ks_neutron_public_port = $os_params::ks_neutron_public_port,
|
||||||
$horizon_port = $os_params::horizon_port,
|
$ks_nova_public_port = $os_params::ks_nova_public_port,
|
||||||
$spice_port = $os_params::spice_port,
|
$ks_swift_public_port = $os_params::ks_swift_public_port,
|
||||||
$vip_public_ip = $os_params::vip_public_ip,
|
$horizon_port = $os_params::horizon_port,
|
||||||
$galera_ip = $os_params::galera_ip
|
$spice_port = $os_params::spice_port,
|
||||||
|
$vip_public_ip = $os_params::vip_public_ip,
|
||||||
|
$galera_ip = $os_params::galera_ip
|
||||||
){
|
){
|
||||||
|
|
||||||
class { 'haproxy':
|
class { 'haproxy':
|
||||||
@@ -145,7 +147,14 @@ class cloud::loadbalancer(
|
|||||||
if $glance_api {
|
if $glance_api {
|
||||||
cloud::loadbalancer::listen_http{
|
cloud::loadbalancer::listen_http{
|
||||||
'glance_api_cluster':
|
'glance_api_cluster':
|
||||||
ports => $ks_glance_public_port,
|
ports => $ks_glance_api_public_port,
|
||||||
|
listen_ip => $vip_public_ip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if $glance_registry {
|
||||||
|
cloud::loadbalancer::listen_http{
|
||||||
|
'glance_registry_cluster':
|
||||||
|
ports => $ks_glance_registry_internal_port,
|
||||||
listen_ip => $vip_public_ip;
|
listen_ip => $vip_public_ip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,7 @@ describe 'cloud::compute::controller' do
|
|||||||
rabbit_hosts => ['10.0.0.1'],
|
rabbit_hosts => ['10.0.0.1'],
|
||||||
rabbit_password => 'secrete',
|
rabbit_password => 'secrete',
|
||||||
ks_glance_internal_host => '10.0.0.1',
|
ks_glance_internal_host => '10.0.0.1',
|
||||||
glance_port => '9292',
|
glance_api_port => '9292',
|
||||||
verbose => true,
|
verbose => true,
|
||||||
debug => true }"
|
debug => true }"
|
||||||
end
|
end
|
||||||
|
@@ -30,7 +30,7 @@ describe 'cloud::compute::hypervisor' do
|
|||||||
rabbit_hosts => ['10.0.0.1'],
|
rabbit_hosts => ['10.0.0.1'],
|
||||||
rabbit_password => 'secrete',
|
rabbit_password => 'secrete',
|
||||||
ks_glance_internal_host => '10.0.0.1',
|
ks_glance_internal_host => '10.0.0.1',
|
||||||
glance_port => '9292',
|
glance_api_port => '9292',
|
||||||
verbose => true,
|
verbose => true,
|
||||||
debug => true }"
|
debug => true }"
|
||||||
end
|
end
|
||||||
|
@@ -23,19 +23,19 @@ describe 'cloud::image' do
|
|||||||
shared_examples_for 'openstack image' do
|
shared_examples_for 'openstack image' do
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{ :glance_db_host => '10.0.0.1',
|
{ :glance_db_host => '10.0.0.1',
|
||||||
:glance_db_user => 'glance',
|
:glance_db_user => 'glance',
|
||||||
:glance_db_password => 'secrete',
|
:glance_db_password => 'secrete',
|
||||||
:ks_keystone_internal_host => '10.0.0.1',
|
:ks_keystone_internal_host => '10.0.0.1',
|
||||||
:ks_glance_internal_port => '9292',
|
:ks_glance_api_internal_port => '9292',
|
||||||
:ks_glance_password => 'secrete',
|
:ks_glance_password => 'secrete',
|
||||||
:rabbit_host => '10.0.0.1',
|
:rabbit_host => '10.0.0.1',
|
||||||
:rabbit_password => 'secrete',
|
:rabbit_password => 'secrete',
|
||||||
:rbd_store_user => 'glance',
|
:rbd_store_user => 'glance',
|
||||||
:rbd_store_pool => 'images',
|
:rbd_store_pool => 'images',
|
||||||
:debug => true,
|
:debug => true,
|
||||||
:verbose => true,
|
:verbose => true,
|
||||||
:api_eth => '10.0.0.1' }
|
:api_eth => '10.0.0.1' }
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'configure glance-api' do
|
it 'configure glance-api' do
|
||||||
|
@@ -23,44 +23,45 @@ describe 'cloud::loadbalancer' do
|
|||||||
shared_examples_for 'openstack loadbalancer' do
|
shared_examples_for 'openstack loadbalancer' do
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{ :ceilometer_api => true,
|
{ :ceilometer_api => true,
|
||||||
:cinder_api => true,
|
:cinder_api => true,
|
||||||
:glance_api => true,
|
:glance_api => true,
|
||||||
:neutron_api => true,
|
:neutron_api => true,
|
||||||
:heat_api => true,
|
:heat_api => true,
|
||||||
:heat_cfn_api => true,
|
:heat_cfn_api => true,
|
||||||
:heat_cloudwatch_api => true,
|
:heat_cloudwatch_api => true,
|
||||||
:nova_api => true,
|
:nova_api => true,
|
||||||
:ec2_api => true,
|
:ec2_api => true,
|
||||||
:metadata_api => true,
|
:metadata_api => true,
|
||||||
:swift_api => true,
|
:swift_api => true,
|
||||||
:keystone_api_admin => true,
|
:keystone_api_admin => true,
|
||||||
:keystone_api => true,
|
:keystone_api => true,
|
||||||
:horizon => true,
|
:horizon => true,
|
||||||
:spice => true,
|
:spice => true,
|
||||||
:haproxy_auth => 'root:secrete',
|
:haproxy_auth => 'root:secrete',
|
||||||
:keepalived_state => 'BACKUP',
|
:keepalived_state => 'BACKUP',
|
||||||
:keepalived_priority => 50,
|
:keepalived_priority => 50,
|
||||||
:keepalived_interface => 'eth0',
|
:keepalived_interface => 'eth0',
|
||||||
:keepalived_ipvs => ['10.0.0.1', '10.0.0.2'],
|
:keepalived_ipvs => ['10.0.0.1', '10.0.0.2'],
|
||||||
:keepalived_localhost_ip => '127.0.0.1',
|
:keepalived_localhost_ip => '127.0.0.1',
|
||||||
:horizon_port => '80',
|
:horizon_port => '80',
|
||||||
:spice_port => '6082',
|
:spice_port => '6082',
|
||||||
:vip_public_ip => '10.0.0.3',
|
:vip_public_ip => '10.0.0.3',
|
||||||
:galera_ip => '10.0.0.4',
|
:galera_ip => '10.0.0.4',
|
||||||
:ks_ceilometer_public_port => '8777',
|
:ks_ceilometer_public_port => '8777',
|
||||||
:ks_nova_public_port => '8774',
|
:ks_nova_public_port => '8774',
|
||||||
:ks_ec2_public_port => '8773',
|
:ks_ec2_public_port => '8773',
|
||||||
:ks_metadata_public_port => '8777',
|
:ks_metadata_public_port => '8777',
|
||||||
:ks_glance_public_port => '9292',
|
:ks_glance_api_public_port => '9292',
|
||||||
:ks_swift_public_port => '8080',
|
:ks_glance_registry_internal_port => '9191',
|
||||||
:ks_keystone_public_port => '5000',
|
:ks_swift_public_port => '8080',
|
||||||
:ks_keystone_admin_port => '35357',
|
:ks_keystone_public_port => '5000',
|
||||||
:ks_cinder_public_port => '8776',
|
:ks_keystone_admin_port => '35357',
|
||||||
:ks_neutron_public_port => '9696',
|
:ks_cinder_public_port => '8776',
|
||||||
:ks_heat_public_port => '8004',
|
:ks_neutron_public_port => '9696',
|
||||||
:ks_heat_cfn_public_port => '8000',
|
:ks_heat_public_port => '8004',
|
||||||
:ks_heat_cloudwatch_public_port => '8003' }
|
:ks_heat_cfn_public_port => '8000',
|
||||||
|
:ks_heat_cloudwatch_public_port => '8003' }
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'configure haproxy server' do
|
it 'configure haproxy server' do
|
||||||
|
Reference in New Issue
Block a user