This figure gives you an illustration of Kubernetes architecture. It shows how a Kubernetes cluster with all the components tied together.
Control Plane Components ( Master node )
If you are interested to see the definition of each component please refer to the official documentation, for ease of access I have given the corresponding link.
To see what it is and how it is implemented in the k8s cluster we will go through each component.
We will Walk Through the Server
We have a 3 node cluster, to list the master and associated worker node execute the command “kubectl get nodes”.
List all the nodes in the cluster
rajith@k8s-master:~$ kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master Ready control-plane,master 15d v1.21.1 node-1 Ready <none> 15d v1.21.1 node-2 Ready <none> 15d v1.21.1 node-3 Ready <none> 15d v1.21.1 rajith@k8s-master:~$
Use “kubectl cluster-info” command to display the addresses of the control plane and the cluster services. This will give an idea on which IP the API server bounded to and which port it is listening etc.
Display the addresses of the master node and services
rajith@k8s-master:~$ kubectl cluster-info Kubernetes control plane is running at https://192.168.50.10:6443 CoreDNS is running at https://192.168.50.10:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. rajith@k8s-master:~$
List the Control Plane Components
We had a quick look at the server. Now let us have a look at the control-plane components.
Before that, we will understand a few concepts and commands. If you find it hard to understand the below points, don’t worry. Skip those points and go on. These are here to give an overview of the command combination we used below. We are discussing it in detail later.
- The command ‘kubectl get pods’ display the pods running on a k8s cluster.
- The Kubernetes environment is further isolated with a concept called a namespace. We will have a detailed study on it later.
- The objects running on a particular namespace can be listed with -n < namespace > along with the suitable commands.
- The control-plane components are running as a pod in the master node.
- There is a concept called static pods.
- The control-plane components making use of this method to start.
- The static pod will be suffixed with the node name in which they started.
- The control plane components are placed under the namespace called ‘kube-system’ .
We got all the details to filter the control-plane components. We will form the command from it.
kubectl get pods -n kube-system |grep master
Will execute it on a server and see the result.
rajith@k8s-master:~$ kubectl get pods -n kube-system |grep master etcd-k8s-master 1/1 Running 7 15d kube-apiserver-k8s-master 1/1 Running 7 15d kube-controller-manager-k8s-master 1/1 Running 7 15d kube-scheduler-k8s-master 1/1 Running 7 15d rajith@k8s-master:~$
Now go back and look at the name of the components we discussed and compare it with the above output.
Ya it is same , we can see all the control-plane components are running on master node under the namespace kube-system. Thats what we explained with the eight points :) .