You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
2.9 KiB

  1. OpenStack
  2. ===============
  3. To deploy kubespray on [OpenStack](https://www.openstack.org/) uncomment the `cloud_provider` option in `group_vars/all.yml` and set it to `'openstack'`.
  4. After that make sure to source in your OpenStack credentials like you would do when using `nova-client` by using `source path/to/your/openstack-rc`.
  5. The next step is to make sure the hostnames in your `inventory` file are identical to your instance names in OpenStack.
  6. Otherwise [cinder](https://wiki.openstack.org/wiki/Cinder) won't work as expected.
  7. Unless you are using calico you can now run the playbook.
  8. **Additional step needed when using calico:**
  9. Calico does not encapsulate all packages with the hosts ip addresses. Instead the packages will be routed with the PODs ip addresses directly.
  10. OpenStack will filter and drop all packages from ips it does not know to prevent spoofing.
  11. In order to make calico work on OpenStack you will need to tell OpenStack to allow calicos packages by allowing the network it uses.
  12. First you will need the ids of your OpenStack instances that will run kubernetes:
  13. nova list --tenant Your-Tenant
  14. +--------------------------------------+--------+----------------------------------+--------+-------------+
  15. | ID | Name | Tenant ID | Status | Power State |
  16. +--------------------------------------+--------+----------------------------------+--------+-------------+
  17. | e1f48aad-df96-4bce-bf61-62ae12bf3f95 | k8s-1 | fba478440cb2444a9e5cf03717eb5d6f | ACTIVE | Running |
  18. | 725cd548-6ea3-426b-baaa-e7306d3c8052 | k8s-2 | fba478440cb2444a9e5cf03717eb5d6f | ACTIVE | Running |
  19. Then you can use the instance ids to find the connected [neutron](https://wiki.openstack.org/wiki/Neutron) ports:
  20. neutron port-list -c id -c device_id
  21. +--------------------------------------+--------------------------------------+
  22. | id | device_id |
  23. +--------------------------------------+--------------------------------------+
  24. | 5662a4e0-e646-47f0-bf88-d80fbd2d99ef | e1f48aad-df96-4bce-bf61-62ae12bf3f95 |
  25. | e5ae2045-a1e1-4e99-9aac-4353889449a7 | 725cd548-6ea3-426b-baaa-e7306d3c8052 |
  26. Given the port ids on the left, you can set the `allowed_address_pairs` in neutron:
  27. # allow kube_service_addresses network
  28. neutron port-update 5662a4e0-e646-47f0-bf88-d80fbd2d99ef --allowed_address_pairs list=true type=dict ip_address=10.233.0.0/18
  29. neutron port-update e5ae2045-a1e1-4e99-9aac-4353889449a7 --allowed_address_pairs list=true type=dict ip_address=10.233.0.0/18
  30. # allow kube_pods_subnet network
  31. neutron port-update 5662a4e0-e646-47f0-bf88-d80fbd2d99ef --allowed_address_pairs list=true type=dict ip_address=10.233.64.0/18
  32. neutron port-update e5ae2045-a1e1-4e99-9aac-4353889449a7 --allowed_address_pairs list=true type=dict ip_address=10.233.64.0/18
  33. Now you can finally run the playbook.