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 (
containerdrecommended)Install
kubeadm,kubeletandkubectlon 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/16The above command will create a file
admin.confin/etc/kubernetesdirectory which can be used to authenticate tokubectl. Follow the on-screen instructions to move this file to the.kubefolder in the user’s home directory.We can now run
kubectlcommands from the master node.The output of the
kubeadm initcommand returns akubeadm joincommand 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 applycommand 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 initcommand.
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
wget https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml

Last updated
