Kubelet

247

The kubelet is the primary “node agent” that runs on each node.

The kubelet monitors resources like CPU, memory, disk space, and filesystem inodes on your cluster’s nodes. When one or more of these resources reach specific consumption levels, the kubelet can proactively fail one or more pods on the node to reclaim resources and prevent starvation.

Stuff you wanna know:

  1. Kubelets can register the node with the apiserver. It does so, using one of — the hostname; a flag to override the hostname; or specific logic for a cloud provider.
  2. The kubelet takes a set of PodSpecs that are provided through various mechanisms and ensures that the containers described in those PodSpecs are running and healthy.
  3. The kubelet can also listen for HTTP and respond to a simple API to submit a new manifest.
  4. A kubelet’s HTTPS endpoint exposes APIs which give access to data of varying sensitivity, and allow you to perform operations with varying levels of power on the node and within containers.
  5. The kubelet uses certificates for authenticating to the Kubernetes API.
  6. The kubelet doesn’t manage containers which were not created by Kubernetes.
  7. Since the kubelet is a daemon, it needs to be maintained by some kind of an init system or service manager.
  8. Some kubelet configuration details need to be the same across all kubelets involved in the cluster, while other configuration aspects need to be set on a per-kubelet basis to accommodate the different characteristics of a given machine (such as OS, storage, and networking).
  9. The lifecycle of the kubeadm CLI tool is decoupled from the kubelet. (The kubeadm CLI tool is executed by the user when Kubernetes is initialized or upgraded, whereas the kubelet is always running in the background.)
  10. When the kubelet is installed using DEBs or RPMs, systemd is configured to manage the kubelet. (You can use a different service manager instead, but you need to configure it manually.)

Ref:

  1. https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/
  2. https://kubernetes.io/docs/concepts/overview/components/
  3. https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/compare-Kubernetes-kubectl-vs-kubelet-when-to-use
  4. https://github.com/kubernetes/kubelet
  5. https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet-authentication-authorization/
  6. https://kubernetes.io/docs/tasks/kubelet-credential-provider/kubelet-credential-provider/
  7. https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/
  8. https://kubernetes.io/docs/tasks/tls/certificate-rotation/
  9. https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/
  10. https://kubernetes.io/blog/2018/07/11/dynamic-kubelet-configuration/
  11. https://kubernetes.io/docs/tasks/administer-cluster/reconfigure-kubelet/
  12. https://kubernetes.io/docs/reference/config-api/kubelet-config.v1alpha1/
  13. https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/kubelet-integration/
  14. https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet-tls-bootstrapping/