Open prateek2408 opened 6 years ago
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_groupname], 'nics': 'port-name={{ item }}', 'image': self.options['image']}, 'register': 'os%s' % role, 'with_items': os_instance_names}
============================================================
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-
'image': self.options['image']
============================================================
Openstack Version - Mitaka Kubespray Version - 2.3.0