What Is The Difference between a Kubernetes Service, the Kubelet, and the Kubernetes API?

Question
You know of different Kubernetes components: the Kubernetes Service, the Kubelet, and the Kubernetes API.  What do these components do and how are they different?

Answer
A Kubernetes service is an entity, that may span nodes, that keeps a group of Pods functional and coherent (paraphrased from this site).  A "[s]ervice will get its own IP address and port" as quoted from page 339 of Kubernetes in Action.  The IP address that they get is not actually pingable; this was also taken from page 339 of Kubernetes in Action. To learn more about a service, you can see this posting.

The Kubelet manages the Pods and the underlying containers running on the worker nodes (as contradistinguished from the master nodes).  (To read more, see page 326 of Kubernetes in Action.)

"The kubelet is the primary “node agent” that runs on each node. The kubelet works in terms of a PodSpec. A PodSpec is a YAML or JSON object that describes a pod. The kubelet takes a set of PodSpecs that are provided through various mechanisms (primarily through the apiserver) and ensures that the containers described in those PodSpecs are running and healthy. The kubelet doesn’t manage containers which were not created by Kubernetes." This quote was taken from Kubernetes.io.

The Kubernetes API resides on the master node(s) to interact with the Kubelet on various nodes.  If you run programs that invoke the Kubernetes API, it will execute operations via the Kubelet running on the nodes.  (To read more, see page 326 of Kubernetes in Action.)

To learn more about Kubernetes, you may want to purchase a book on the subject other than the one cited above.

Leave a comment

Your email address will not be published. Required fields are marked *