Nodes
Nodes
Nodes are physical or VM servers where the cluster is deployed. Nodes have roles, either master or worker. A Node is an API object created outside the cluster representing an instance.
We can create a master node with:
kubeadm init
and worker nodes:
kubeadm join
To remove nodes:
kubectl delete node $nodename
# remove cluster-specific information
kubeadm reset
To view current node status:
kubectl describe node $nodename
All nodes run the following components:
kubelet: Ensures that containers are running in aPod.- Receives resource specifications (
PodSpec) and ensures that the node meets the desired specs working withcontainer-runtime - Ensures that a
Podhas access to specified storage,SecretsorConfigMaps. - Reports status of
Pods to cluster.
- Receives resource specifications (
kube-proxy: Network proxy implemented as aService. It maintains network rules on the node based on IP tables so that internal and external clients can communicate with thePods.container-runtime: Works withkubeletto ensure specified containers are running and healthy. It's an interface between Kubernetes and the container/Docker Engine.
Master Node
The Master node runs various management services for the whole cluster, mainly:
kube-apiserver: All calls (internal and external traffic) are handled with this agent. It is the only connection to theetcddatabase. Acts as a master process for the entire cluster.kube-scheduler: Responsible for assigning Pods to Nodes by provided specification (labels, taints, toletations, number of replicas, state)etcd: key-value database where the state of the cluster information, as well as other persistent data and networking is kept. Requests to update DB is load-balanced bykube-apiserverand distributed to database in series.etcdctlcan be used to interact with db.kube-controller-manager: Determines the state of the cluster by interaction withkube-apiserver. If any action is needed, it alerts other controllers (endpoints, namespaces, replicasets) of need to add/remove resources.
Worker Node
The Worker Node hosts the applications workload.