Skip to content

Commit

Permalink
Use kubernetes network for management
Browse files Browse the repository at this point in the history
If no controllers are present, currently fuel may allocate the .1 on the
management network which can lead to weird results.  So for now if no
controllers are in the environment, then use the kubernetes network for
management functions.

Also update flannel options to match the other classes and remove the
extra - before -etcd-servers
  • Loading branch information
Alex Schultz committed May 20, 2016
1 parent 83bbb74 commit c8e48ee
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
6 changes: 6 additions & 0 deletions deployment_scripts/puppet/modules/flannel/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
tag => [ 'flanneld', ],
}

$flanneld_opts = join([
"-etcd-endpoints=${etcd_servers}",
"-iface=${net_iface}",
'-ip-masq',
], ' ')

file { '/etc/init/flanneld.conf':
ensure => present,
mode => '0644',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# FLANNEL="/opt/bin/flanneld"

# Use FLANNEL_OPTS to modify the start/restart options
FLANNEL_OPTS="--etcd-endpoints=<%=@etcd_servers%> -iface=<%=@net_iface%> -ip-masq"
FLANNEL_OPTS="<%=@flanneld_opts%>"
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# could but we'll need to switch out management ips for the peers
keepalived::vrrp::instance { $::plugin_k8s::params::vip_name:
interface => $::plugin_k8s::params::mgmt_interface,
state => 'BACKUP',
state => $::plugin_k8s::params::keepalived_state,
nopreempt => true,
virtual_router_id => '50',
priority => '100',
Expand Down
19 changes: 15 additions & 4 deletions deployment_scripts/puppet/modules/plugin_k8s/manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
prepare_network_config($network_scheme)
$network_metadata = hiera_hash('network_metadata', {})


if empty(get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])) {
# TODO: The management doesn't work right if you don't have any controllers
# so use the kubernetes network for management functions
$management_network = 'kubernetes'
} else {
$management_network = 'management'
}
# networking params
# fuel network-group --create --node-group 2 --name kubernetes --release 1 --vlan 1000 --cidr 10.244.0.0/16
$cluster_interface = pick(get_network_role_property('kubernetes', 'interface'), 'br-kubernetes')
Expand All @@ -46,14 +54,14 @@
# node params
$node = hiera('node')
$node_name = $node['name']
$mgmt_ip = get_network_role_property('management', 'ipaddr')
$mgmt_interface = get_network_role_property('management', 'interface')
$mgmt_ip = get_network_role_property($management_network, 'ipaddr')
$mgmt_interface = get_network_role_property($management_network, 'interface')
$bind_address = $mgmt_ip
$primary_controller = roles_include('primary-kubernetes-controller')

# controllers
$controller_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-kubernetes-controller', 'kubernetes-controller'])
$controller_mgmt_nodes = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'management')
$controller_mgmt_nodes = get_node_to_ipaddr_map_by_network_role($controller_nodes, $management_network)
$controller_mgmt_ips = ipsort(values($controller_mgmt_nodes))


Expand Down Expand Up @@ -88,8 +96,10 @@

# HA settings
if $api_server_count > 1 {
$keepalived_state = 'BACKUP'
$leader_elect = true
} else {
$keepalived_state = 'MASTER'
$leader_elect = false
}

Expand All @@ -99,7 +109,8 @@
$flannel_proto = 'udp'

# kubelet settings
$dns_server = hiera('management_vrouter_vip')
#$dns_server = hiera('management_vrouter_vip')
$dns_server = hiera('master_ip') # TODO fixme
$dns_domain = 'test.domain.local' # TODO fix me
$proxy_mode = $networking ? {
default => undef,
Expand Down

0 comments on commit c8e48ee

Please sign in to comment.