Abstract
A kubelet in every node.
Kubelets#
The kubelet can be thought of as the most basic unit of a Kubernetes cluster since one is required on every node, including the control planes. It kind of ties the room together, so don’t let it get wet.
Preparing Worker nodes#
Hypothetically the only things that required to tie the worker nodes
together should be the control plane and the kubelet running on them.
There are some limitations or difficulties. The author’s understanding at
the time of writing is that running Windows worker nodes in concert with
*nix
worker nodes is not a simple proposition. The reason for this is
irrelevant since we’ll be running Linux, ArchLinux specifically, for
all of our nodes.
That said, as long as your nodes are all running a version of Linux, you should be able to run a kubelet on them and join it to your control plane without too much fuss.
The editorial staff of whatever entity controls the creation and distribution of this work is much too lazy and solipsistic to go into a detailed explanation of the process here, so to cover all the bases, make sure to RTFM on the actual manual’s site.
Installation#
Since we’re all friends who know how to use ArchLinux, we’ll go ahead and install the kubelet on three of our computers using the command below.
Install kubelet with
yay
on all of your worker nodes.yay -S kubelet
For the contrarians, you may also install the kubelet from the AUR manually.
Clone the related repository.
git clone https://aur.archlinux.org/kubelet.git
Update your working directory.
cd kubelet
Use
makepkg
to create and install the package.makepkg -si
But enough showing off, back to the salt mines.
Enable the kubelet with
systemd
sudo systemctl enable kubelet
Join the cluster#
This process is completed in three simple steps.
Connect to the control plane.
ssh the-control-plane
Check the control plane node status.
kubectl get nodes
Use kubeadm to print your join command.
sudo kubeadm token create --print-join-command
Connect to your worker nodes individually, or using a configuration management tool like Ansible[1]
ssh {worker-node-one,worker-node-two,worker-node-three}
Run the join command obtained above for each node you need to join.
run this on each node to be joined#kubeadm join 192.168.100.5:6443 --token abcdef.abcdefghijklmnop \ --discovery-token-ca-cert-hash sha256:eba12bf8e45c71c0747df39212f0f7d7d6c4b88a9d82fd44a70d6b0b247415c2
a successful join#[preflight] Running pre-flight checks [WARNING Swap]: swap is supported for cgroup v2 only. The kubelet must be properly configured to use swap. Please refer to https://kubernetes.io/docs/concepts/architecture/nodes/#swap-memory, or disable swap on the node [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service' [preflight] Reading configuration from the "kubeadm-config" ConfigMap in namespace "kube-system"... [preflight] Use 'kubeadm init phase upload-config --config your-config-file' to re-upload it. [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-check] Waiting for a healthy kubelet at http://127.0.0.1:10248/healthz. This can take up to 4m0s [kubelet-check] The kubelet is healthy after 3.502506434s [kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap 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.
If this completes without error, congratulations, you’re probably wondering why none of your nodes will show ready in your cluster. For that, we’ll need to install a Networking Add On.
This will be covered next week’s post, Flannel for networking.