Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubespray in Openstack does not allocate floating IP #119

Open
prateek2408 opened this issue Jan 2, 2018 · 1 comment
Open

Kubespray in Openstack does not allocate floating IP #119

prateek2408 opened this issue Jan 2, 2018 · 1 comment

Comments

@prateek2408
Copy link

Even after giving "--floating_ip" in the "kubesrpay openstack" command the Virtual machines that are created in openstack Cloud does not get a floating IP.

Also there is no option to provide the name of external network from which the floating IP would be taken and associated to Virtual machines . Setting auto_ip to true does not provide floating IP to the VM's

snippet-

                       'flavor': self.options['%s_flavor' % role],
                       'key_name': self.options['sshkey'],
                       'region_name': self.options['os_region_name'],
                       'auto_ip': self.options['floating_ip'],
                       'security_groups': [os_security_group_name],
                       'nics': 'port-name={{ item }}',

'image': self.options['image']

============================================================

Openstack Version - Mitaka
Kubespray Version - 2.3.0

@prateek2408
Copy link
Author

The solution to this problem is to use floatingip_pools and provide the name of external network provided by user either is CLI or kubesrpay yaml file.

Here are the proposed changes in the cloud.py-

=================================

    if self.options['floating_ip']:
        ip_type = 'public'
        auto_ans = 'yes'
        pool_name = 'external' 

Here external pool would be replaced with the name of external network that is present in the Openstack environment, can be taken as command line argument or from config

=================================

=================================
self.pbook_content[0]['tasks'].append(
{'name': 'Provision OS %s instances' % role,
'os_server': {
'auth': openstack_auth,
'name': '{{item}}',
'state': 'present',
'flavor': self.options['%s_flavor' % role],
'key_name': self.options['sshkey'],
'region_name': self.options['os_region_name'],
#'auto_ip': auto_ans,
'floating_ip_pools': pool_name,

'security_groups': [os_security_group_name],
'nics': 'port-name={{ item }}',
'image': self.options['image']},
'register': 'os_%s' % role,
'with_items': os_instance_names}

============================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant