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.

133 lines
6.2 KiB

  1. # OpenStack
  2. ## Known compatible public clouds
  3. Kubespray has been tested on a number of OpenStack Public Clouds including (in alphabetical order):
  4. - [Auro](https://auro.io/)
  5. - [Betacloud](https://www.betacloud.io/)
  6. - [CityCloud](https://www.citycloud.com/)
  7. - [DreamHost](https://www.dreamhost.com/cloud/computing/)
  8. - [ELASTX](https://elastx.se/)
  9. - [EnterCloudSuite](https://www.entercloudsuite.com/)
  10. - [FugaCloud](https://fuga.cloud/)
  11. - [Infomaniak](https://infomaniak.com)
  12. - [Open Telekom Cloud](https://cloud.telekom.de/) : requires to set the variable `wait_for_floatingip = "true"` in your cluster.tfvars
  13. - [OVHcloud](https://www.ovhcloud.com/)
  14. - [Rackspace](https://www.rackspace.com/)
  15. - [Ultimum](https://ultimum.io/)
  16. - [VexxHost](https://vexxhost.com/)
  17. - [Zetta](https://www.zetta.io/)
  18. ## The OpenStack cloud provider
  19. The cloud provider is configured to have Octavia by default in Kubespray.
  20. - Enable the external OpenStack cloud provider in `group_vars/all/all.yml`:
  21. ```yaml
  22. cloud_provider: external
  23. external_cloud_provider: openstack
  24. ```
  25. - Enable Cinder CSI in `group_vars/all/openstack.yml`:
  26. ```yaml
  27. cinder_csi_enabled: true
  28. ```
  29. - Enable topology support (optional), if your openstack provider has custom Zone names you can override the default "nova" zone by setting the variable `cinder_topology_zones`
  30. ```yaml
  31. cinder_topology: true
  32. ```
  33. - Enabling `cinder_csi_ignore_volume_az: true`, ignores volumeAZ and schedules on any of the available node AZ.
  34. ```yaml
  35. cinder_csi_ignore_volume_az: true
  36. ```
  37. - If you are using OpenStack loadbalancer(s) replace the `openstack_lbaas_subnet_id` with the new `external_openstack_lbaas_subnet_id`. **Note** The new cloud provider is using Octavia instead of Neutron LBaaS by default!
  38. - If you are in a case of a multi-nic OpenStack VMs (see [kubernetes/cloud-provider-openstack#407](https://github.com/kubernetes/cloud-provider-openstack/issues/407) and [#6083](https://github.com/kubernetes-sigs/kubespray/issues/6083) for explanation), you should override the default OpenStack networking configuration:
  39. ```yaml
  40. external_openstack_network_ipv6_disabled: false
  41. external_openstack_network_internal_networks: []
  42. external_openstack_network_public_networks: []
  43. ```
  44. - You can override the default OpenStack metadata configuration (see [#6338](https://github.com/kubernetes-sigs/kubespray/issues/6338) for explanation):
  45. ```yaml
  46. external_openstack_metadata_search_order: "configDrive,metadataService"
  47. ```
  48. - Available variables for configuring lbaas:
  49. ```yaml
  50. external_openstack_lbaas_enabled: true
  51. external_openstack_lbaas_floating_network_id: "Neutron network ID to get floating IP from"
  52. external_openstack_lbaas_floating_subnet_id: "Neutron subnet ID to get floating IP from"
  53. external_openstack_lbaas_method: ROUND_ROBIN
  54. external_openstack_lbaas_provider: amphora
  55. external_openstack_lbaas_subnet_id: "Neutron subnet ID to create LBaaS VIP"
  56. external_openstack_lbaas_network_id: "Neutron network ID to create LBaaS VIP"
  57. external_openstack_lbaas_manage_security_groups: false
  58. external_openstack_lbaas_create_monitor: false
  59. external_openstack_lbaas_monitor_delay: 5
  60. external_openstack_lbaas_monitor_max_retries: 1
  61. external_openstack_lbaas_monitor_timeout: 3
  62. external_openstack_lbaas_internal_lb: false
  63. ```
  64. - Run `source path/to/your/openstack-rc` to read your OpenStack credentials like `OS_AUTH_URL`, `OS_USERNAME`, `OS_PASSWORD`, etc. Those variables are used for accessing OpenStack from the external cloud provider.
  65. - Run the `cluster.yml` playbook
  66. ## Additional step needed when using calico or kube-router
  67. Being L3 CNI, calico and kube-router do not encapsulate all packages with the hosts' ip addresses. Instead the packets will be routed with the PODs ip addresses directly.
  68. OpenStack will filter and drop all packets from ips it does not know to prevent spoofing.
  69. In order to make L3 CNIs work on OpenStack you will need to tell OpenStack to allow pods packets by allowing the network they use.
  70. First you will need the ids of your OpenStack instances that will run kubernetes:
  71. ```bash
  72. openstack server list --project YOUR_PROJECT
  73. +--------------------------------------+--------+----------------------------------+--------+-------------+
  74. | ID | Name | Tenant ID | Status | Power State |
  75. +--------------------------------------+--------+----------------------------------+--------+-------------+
  76. | e1f48aad-df96-4bce-bf61-62ae12bf3f95 | k8s-1 | fba478440cb2444a9e5cf03717eb5d6f | ACTIVE | Running |
  77. | 725cd548-6ea3-426b-baaa-e7306d3c8052 | k8s-2 | fba478440cb2444a9e5cf03717eb5d6f | ACTIVE | Running |
  78. ```
  79. 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):
  80. ```bash
  81. openstack port list -c id -c device_id --project YOUR_PROJECT
  82. +--------------------------------------+--------------------------------------+
  83. | id | device_id |
  84. +--------------------------------------+--------------------------------------+
  85. | 5662a4e0-e646-47f0-bf88-d80fbd2d99ef | e1f48aad-df96-4bce-bf61-62ae12bf3f95 |
  86. | e5ae2045-a1e1-4e99-9aac-4353889449a7 | 725cd548-6ea3-426b-baaa-e7306d3c8052 |
  87. ```
  88. 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`.)
  89. ```bash
  90. # allow kube_service_addresses and kube_pods_subnet network
  91. 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
  92. 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
  93. ```
  94. If all the VMs in the tenant correspond to Kubespray deployment, you can "sweep run" above with:
  95. ```bash
  96. openstack port list --device-owner=compute:nova -c ID -f value | xargs -tI@ openstack port set @ --allowed-address ip-address=10.233.0.0/18 --allowed-address ip-address=10.233.64.0/18
  97. ```
  98. Now you can finally run the playbook.