As of May 2018, the latest version of kubespray is 2.5.0, which supports the following operation systems to install Kubernetes:
- RHEL/CentOS 7
- Ubuntu 16.04 LTS
According to the kubespray documentation, it also supports CoreOS and debian distributions. However, those distributions may need some additional steps or have technical difficulties. This cookbook uses CentOS 7 and Ubuntu 16.04 LTS.
In addition, you need to install Ansible on your machine. Ansible works on Python 2.6, 2.7, and 3.5 or higher. macOS and Linux might be the best choice to install Ansible because Python is preinstalled by most of macOS and Linux distributions by default. In order to check which version of Python you have, open a Terminal and type the following command:
//Use capital V
$ python -V
Python 2.7.5
Overall, you need at least three machines, as mentioned in the following table:
Type of host
|
Recommended OS/Distribution
|
Ansible
|
macOS or any Linux which has Python 2.6, 2.7, or 3.5
|
Kubernetes master
|
RHEL/CentOS 7 or Ubuntu 16.04 LTS
|
Kubernetes node
|
RHEL/CentOS 7 or Ubuntu 16.04 LTS
|
There are some network communicating with each other, so you need to at least open a network port (for example, AWS Security Group or GCP Firewall rule) as:
- TCP/22 (ssh): Ansible to Kubernetes master/node host
- TCP/6443 (Kubernetes API server): Kubernetes node to master
- Protocol 4 (IP encapsulated in IP): Kubernetes master and node to each other by Calico
In Protocol 4 (IP encapsulated in IP), if you are using AWS, set an ingress rule to specify aws ec2 authorize-security-group-ingress --group-id <your SG ID> --cidr <network CIDR> --protocol 4. In addition, if you are using GCP, set the firewall rule to specify as cloud compute firewall-rules create allow-calico --allow 4 --network <your network name> --source-ranges <network CIDR>.