Pre-Requisite Openstack
Deployment on Openstack requires some things which should be done in order to get a running kubernetes cluster using kubespray.
N.B -- It assumed that the reader has some operational knowledge of Openstack. Openstack Ocata was used for this deployment.
Below are the requirements:
OPENSTACK RC FILE
Before you initiate the kubespray installation, you need to source your Openstack RC file just like you do when you want to use Openstack CLI commands. Also you need to include 'Openstack Region Name and Tenant ID' in your RC file (it is very likely that you normal RC does not contain this, so ensure it is included). Sample RC is given below and how to source it:
Source RC file:
Kubespray will populate this values in the kubernetes cloud_provider config file
LOAD BALANCER MODULE
Ensure your openstack installation includes the Openstack LBaaS (Load Balancer As A Service, version 2 was used for this deployment). Without this step, you will not be able to use the Load Balancer Service Type in your kubernetes cluster (there will be no external IP address).
HOSTNAME MAPPINGs
Make sure the hostnames in your inventory file are identical to your instance names in Openstack.
CALICO NETWORK PLUGIN
If you are going to use Calico as the Network Plugin, there is need to carry out some additional steps in Neutron (if you are not using Calico, you can skip this step). This is because OpenStack will filter and drop all packets from ips it does not know to prevent spoofing and since Calico advertises POD and Cluster IP addresses, Openstack will drop them.
Then you can use the instance ids to find the connected neutron ports:
Given the port ids on the left, you can set the allowed_address_pairs in neutron. Note that you have to allow both of kube_service_addresses (default 10.233.0.0/18) and kube_pods_subnet (default 10.233.64.0/18)
You can proceed to deploy the cluster.
N.B -- It is assumed that the IP addresses are the defaults, if not then adjust accordingly.
Last updated