This project uses Terraform to bootstrap a cluster on OpenStack and installs Kubernetes on it via kubeadm.
Before you can start, you need to generate a fresh token for kubeadm to use. Install kubeadm on your local machine (or somewhere else) and run kubeadm token generate
. When you run terraform apply
, it will ask for the kubeadm token you generated.
Make sure you sourced your openstack.rc
file before running terraform apply
.
By default one master and three worker nodes are bootstrapped. Please check variables.tf to see settings that you typically want to change. All scripts assume Ubuntu 16.04 as the operating system on the master and workers.
After terraform finishes, you will be able to connect to the master and run this:
$ export KUBECONFIG=/etc/kubernetes/admin.conf
$ kubectl get nodes
NAME STATUS AGE VERSION
staging-master Ready 3m v1.6.4
staging-worker0 Ready 1m v1.6.4
staging-worker1 Ready 1m v1.6.4
staging-worker2 Ready 1m v1.6.4
This project removes the taint from the master that prohibits Kubernetes from scheduling pods on the master.
kubeadm
is still in beta and will output the warning:
WARNING: kubeadm is in beta, please do not use it for production clusters.
You should take this seriously. kubeadm
only bootstraps a cluster with a single master so you don't have any fault tolerance.
This project bootstraps Flannel as a virtual network with the address space 10.244.0.0/16
. For other options check this page.