Kubernetes: High-level Steps for Deploying Kubernetes with Kubeadm
The general procedures for deploying a Kubernetes cluster using Kubeadm.
Assuming we have one master and one worker node, here are the high-level steps to deploy a Kubernetes cluster using Kubeadm.
- (master node, worker node) Install container runtime
You can find instructions on how to do this in the official Kubernetes documentation.
Note: Dockershim has been removed from the Kubernetes project as of release 1.24. Read the Dockershim Removal FAQ for…
2. (master node, worker node) Install Kubeadm, Kubelet, and Kubectl
You can find instructions on how to do this for your specific operating system in the official Kubernetes documentation.
This page shows how to install the kubeadm toolbox. For information on how to create a cluster with kubeadm once you…
Use below command to check the Linux distribution running on the current machine:
$ cat /etc/*-release
3. (master node) Initialize the control-plane node
$ kubeadm init <args>
This will download the necessary Kubernetes components and generate a kubeconfig file that you can use to authenticate to the cluster.
Creating a cluster with kubeadm
Using kubeadm, you can create a minimum viable Kubernetes cluster that conforms to best practices. In fact, you can use…
4. (master node) Configure kubectl
Follow the instructions output by the
kubeadm init command.
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
5. (worker node) Join the worker node to the cluster
$ kubeadm join --token <token> <control-plane-host>:<control-plane-port> --discovery-token-ca-cert-hash sha256:<hash>
kubeadm join command with the necessary parameters, such as the IP address of the master node and the token generated by the
kubeadm init command.
6. (master node) Verify that the worker node has joined the cluster
$ kubectl get nodes
7. (master node) Install a Pod network add-on
Install Flannel, Calico, or Weave Net to enable communication between pods running on different nodes.
$ kubectl apply -f <add-on.yaml>
These are my personal notes for CKA exam preparation on Kubernetes. Please feel free to correct me if you notice any errors. 😊