Installing the Kubernetes client

Perform the following steps:

  1. Like Kubernetes master, we need to upgrade APT with the few dependencies docker.io and apt-transport-https:
apt update && apt upgrade -y

sudo apt install docker.io apt-transport-https -qy

  1. Install Docker and Kubernetes using the following command, used to install kubelet, kubeadm, and kubectl:
apt install docker-ce kubelet kubeadm kubectl kubernetes-cni -y

  1. Let's configure Kubernetes from the Client1 user using the following commands:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
export KUBECONFIG=$HOME/.kube/config
export KUBECONFIG=$HOME/.kube/config | tee -a ~/.bashrc

  1. To connect the Kubernetes client to the master, use the following command:
kubeadm join 10.0.0.5:6443 --token j8pddx.ew4rvqdppx6seclp --discovery-token-ca-cert-hash sha256:00d43aef55fe0fc73041f57e4ebf7676b332bb4c0f53b67a70d2f837a8e30dc8
  1. Run the following command from the master node, and see the node status:
kubectl get nodes

We need to perform similar steps from Client2, and rerun the preceding command, and see whether it's successfully connected to the Kubernetes master. We can see that both nodes, Client1 and Client2 are successfully connected to the master:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.185.147