Your setup is running, everything runs smoothly, and suddenly, ‼️ nothing is responding: your cluster is overloaded.
Well, I hope you’ll expand your cluster capacity before it happens. It’s always really bad and stressful to do maintenance because of downtime.
Hopefully, here comes the real huge advantage of kubernetes: it is meant to scale, up, and down. So, assuming you have followed the full guide so far, let’s review together how to add some juice to our cluster ⚡.
Join the cluster’s VPN
In the step
Setup the cluster's VPN, we have set up a VPN so that each of our nodes can communicate safely with each others, on their own virtual network across the internet. This comes with the great power of being able to have servers spread all around the globe.
From the OpenVPN server node
So, log in to the OpenVPN master server, and run the following to generate a configuration for your brand new machine:
1
2
3
4
5
6
# Generate a clientdocker run -v {{vpn.volumeName}}:/etc/openvpn --rm -it kylemanna/openvpn:2.3 easyrsa build-client-full {{newNode.name}} nopass
# Set its static IPecho"ifconfig-push {{newNode.vpnIp}} {{vpn.serverIp}}"| docker run -v {{vpn.volumeName}}:/etc/openvpn -i --rm kylemanna/openvpn:2.3 tee /etc/openvpn/ccd/{{newNode.name}}# Get its config to your hostdocker run -v {{vpn.volumeName}}:/etc/openvpn --rm kylemanna/openvpn:2.3 ovpn_getclient {{newNode.name}} > {{newNode.name}}.ovpn
Then, move {{newNode.name}}.ovpn to your new node by a safe mean.
From the new node
Install OpenVPN:
1
2
dnf install epel-release
dnf install openvpn
Add the OpenVPN server to your /etc/hosts file (if not a real DNS name).
Since I assume you’ve initialized your cluster a while ago, and your previous cluster’s join token is expired, we are going to create a new one and use it.
If everything worked correctly, you should have an output like below:
1
2
3
4
5
6
7
8
9
10
11
12
13
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...
^[[B
This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.
Run 'kubectl get nodes' on the control-plane to see this node join the cluster.