Kubernetes The Kubeadm Way
Kubeadm
Create the nodes to be used in the cluster
Setup the nodes - forwarding IPv4 and letting iptables see bridged traffic on all the nodes - Container Runtimes | Kubernetes
Install a container runtime on all of the nodes (
containerd
recommended)Install
kubeadm
,kubelet
andkubectl
on all the nodes, refer Installing kubeadm | KubernetesInitialize the control plane node with the pod networking CIDR and the API server endpoint as the control plane’s IP address in its local network so that the worker nodes can reach the API server on the master node’s IP -
kubeadm init --apiserver-advertise-address 10.33.92.10 --pod-network-cidr=10.244.0.0/16
The above command will create a file
admin.conf
in/etc/kubernetes
directory which can be used to authenticate tokubectl
. Follow the on-screen instructions to move this file to the.kube
folder in the user’s home directory.We can now run
kubectl
commands from the master node.The output of the
kubeadm init
command returns akubeadm join
command that needs to be run on all the worker nodes to join them with the master node.Deploy the cluster networking solution (eg. WeaveNet) as a DaemonSet on all the nodes by running a single
k apply
command on the master node, refer Integrating Kubernetes via the Addon (weave.works). Configure the networking solution to use the same CIDR as the pod network configured inkubeadm init
command.
When the K8s cluster is deployed using kubeadm
, all the control plane components (except the kubelet
) are deployed as static pods in the kube-system
namespace.
The manifest files for these components are located at /etc/kubernetes/manifests/
.
Simply editing these manifest files leads to the static pods restarting with the updated config.
Lab
The only thing that was not clear is adding the iface in the Flannel definition yaml, it wasn't mentioned in the lab writeup.
Also, when trying to get yaml from github, make sure to go to the file itself and copy the raw url
Last updated