KubeAdmin (kubeadm)

KubeAdmin (kubeadm)

  • Create the nodes to be used in the cluster
  • Initialize 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 to kubectl. 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 a kubeadm 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 in kubeadm 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.