Warning: This how-to is outdated due to current changes in Kubernetes but remains here for reference.
Containerizing is a new way of deploying apps when high availability and fast increments are required. Kubernetes is an amazing tool for the orchestration of these apps. In this tutorial, we will configure Fuga and deploy Kubernetes on multiple instances.
First, create a security group with access to all ports for inside the security group, so these instances can communicate freely between each other. Go the Security tab, create a new security group and add the rule all TCP in the ‘ingress’ direction with remote ‘Security Group’ and security group current. If you only want to export specific ports, look at the table at the bottom of the page.
Spin up two or more instances with a minimum memory of 2gb (c1.small or up), this is what Kubernetes recommends. Connect these instances to a network. Also, let the instances use the new security group, don’t forget to add a keypair. In this tutorial, we will use Ubuntu 16.04, but other distros are also supported (take a look at https://kubernetes.io/docs/setup/independent/install-kubeadm/). Finally, allocate floating IP addresses for each instance.
Afterward, these floating IP addresses can be added to the ~/.ssh/config file on your local machine. This will make it easier to ssh to them. For example:
Now we SSH to the master instance.
We will need docker to run Kubernetes.
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce
Afterward, We will need to add the Google repository to the sources, so we can install Kubernetes.
sudo apt-get update && sudo apt-get install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
We now can use kubeadm init to start our Kubernetes cluster. But first, we need a pod network. This allows the pods to communicate with each other. If you have already used this command, kubeadm reset reverts this step. In this tutorial, we will use Calico as the pod network.
Stated below are the steps from the Calico quickstart guide:
Initialize the master node. The output from this step will be a kubeadm join command with the following format:
sudo kubeadm join 10.0.0.xxx:xxxxx --token aaaaa.aaaaaaaaaaaaaaaa --discovery-token-ca-cert-hash sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
We will save this for later somewhere because we will need it in the next step when we join the workers to the master node.
sudo kubeadm init --pod-network-cidr=10.10.0.0/16
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
Apply Calico on the master node.
kubectl apply -f \
Now we can see if the pods are running.
watch kubectl get pods --all-namespaces
Now, install docker, kubelet, kubeadm and kubectl on each instance with the steps explained above and then we can join the instances to the master with the command that we saved earlier. If you configured the master instance and ‘joined’ (with kubeadm join ...) all instances to master, you can check with this command if every instance is recognized correctly:
kubectl get nodes
Now you have a Kubernetes cluster on your Fuga instances.
** Default port range for NodePort Services. Any port numbers marked with * are overridable, so you will need to ensure any custom ports you provide are also open.