2016-07-04 12:13:18 +00:00
OpenStack
===============
To deploy kubespray on [OpenStack ](https://www.openstack.org/ ) uncomment the `cloud_provider` option in `group_vars/all.yml` and set it to `'openstack'` .
2018-07-31 18:34:04 +00:00
After that make sure to source in your OpenStack credentials like you would do when using `nova-client` or `neutron-client` by using `source path/to/your/openstack-rc` or `. path/to/your/openstack-rc` .
2016-07-04 12:13:18 +00:00
The next step is to make sure the hostnames in your `inventory` file are identical to your instance names in OpenStack.
Otherwise [cinder ](https://wiki.openstack.org/wiki/Cinder ) won't work as expected.
Unless you are using calico you can now run the playbook.
**Additional step needed when using calico:**
2018-07-31 18:34:04 +00:00
Calico does not encapsulate all packages with the hosts' ip addresses. Instead the packages will be routed with the PODs ip addresses directly.
2016-07-04 12:13:18 +00:00
OpenStack will filter and drop all packages from ips it does not know to prevent spoofing.
2018-07-31 18:34:04 +00:00
In order to make calico work on OpenStack you will need to tell OpenStack to allow calico's packages by allowing the network it uses.
2016-07-04 12:13:18 +00:00
First you will need the ids of your OpenStack instances that will run kubernetes:
2018-07-31 18:34:04 +00:00
openstack server list --project YOUR_PROJECT
2016-07-04 12:13:18 +00:00
+--------------------------------------+--------+----------------------------------+--------+-------------+
| ID | Name | Tenant ID | Status | Power State |
+--------------------------------------+--------+----------------------------------+--------+-------------+
| e1f48aad-df96-4bce-bf61-62ae12bf3f95 | k8s-1 | fba478440cb2444a9e5cf03717eb5d6f | ACTIVE | Running |
| 725cd548-6ea3-426b-baaa-e7306d3c8052 | k8s-2 | fba478440cb2444a9e5cf03717eb5d6f | ACTIVE | Running |
2018-07-31 18:34:04 +00:00
Then you can use the instance ids to find the connected [neutron ](https://wiki.openstack.org/wiki/Neutron ) ports (though they are now configured through using OpenStack):
2016-07-04 12:13:18 +00:00
2018-07-31 18:34:04 +00:00
openstack port list -c id -c device_id --project YOUR_PROJECT
2016-07-04 12:13:18 +00:00
+--------------------------------------+--------------------------------------+
| id | device_id |
+--------------------------------------+--------------------------------------+
| 5662a4e0-e646-47f0-bf88-d80fbd2d99ef | e1f48aad-df96-4bce-bf61-62ae12bf3f95 |
| e5ae2045-a1e1-4e99-9aac-4353889449a7 | 725cd548-6ea3-426b-baaa-e7306d3c8052 |
2018-07-31 18:34:04 +00:00
Given the port ids on the left, you can set the two `allowed_address` (es) in OpenStack. Note that you have to allow both `kube_service_addresses` (default `10.233.0.0/18` ) and `kube_pods_subnet` (default `10.233.64.0/18` .)
2016-07-04 12:13:18 +00:00
2017-06-19 13:48:34 +00:00
# allow kube_service_addresses and kube_pods_subnet network
2018-09-19 12:50:38 +00:00
openstack port set 5662a4e0-e646-47f0-bf88-d80fbd2d99ef --allowed-address ip-address=10.233.0.0/18 --allowed-address ip-address=10.233.64.0/18
openstack port set e5ae2045-a1e1-4e99-9aac-4353889449a7 --allowed-address ip-address=10.233.0.0/18 --allowed-address ip-address=10.233.64.0/18
2016-07-04 12:13:18 +00:00
Now you can finally run the playbook.