iorchard / burrito

Burrito - OpenStack on K8S platform
Apache License 2.0
1 stars 4 forks source link

/etc/hosts issue when adding new nodes #3

Closed beomjins closed 1 year ago

beomjins commented 1 year ago

When you add a new computer node, /etc/hosts does not generate an address for cinder.

new compute node

$ cat /etc/hosts ... 192.168.xx.xx control01.cluster.local control01

In this case, VM creation fails due to lack of connection refuse with cinder.

$ curl -v http://cinder.openstack.svc.cluster.local:8080 ...

If you add the following information to /etc/hosts and restart the pod, it will be connected to the cinder and operate normally.

$ sudo vi /etc/hosts ... 192.168.20.11 control01.cluster.local control01 cinder.openstack.svc.cluster.local

$ curl -v http://cinder.openstack.svc.cluster.local:8080 ...

Please check the above issue.

jijisa commented 1 year ago

There is a task to add openstack service endpoints in /etc/hosts on k8s node. It's in burrito.system role of kubespray playbook.

- name: Setup | add openstack each fqdn in /etc/hosts
  ansible.builtin.lineinfile:
    path: "/etc/hosts"
    state: present
    regexp: "^{{ keepalived_vip }}"
    line: "{{ keepalived_vip }} {{ openstack_fqdn | join(' ') }}"
  become: true

So the result should be like this.

192.168.21.90 keystone.openstack.svc.cluster.local glance.openstack.svc.cluster.local nova.openstack.svc.cluster.local neutron.openstack.svc.cluster.local metadata.openstack.svc.cluster.local cinder.openstack.svc.cluster.local barbican.openstack.svc.cluster.local

192.168.21.90 is the keepalived VIP on management interface.

So I think you didn't run burrito.system role when you add a new node.

Here is the document to add a new compute node. https://burrito.readthedocs.io/en/latest/operation/add_compute_node.html