Skip to main content
In Kubernetes, the kubelet acts as the “captain” on each worker node. It:
  • Registers the node with the control plane.
  • Starts and stops containers per Pod specs.
  • Monitors Pod and container health, reporting back to the API Server.
Just like a ship’s captain must secure communications with the harbor master, you must lock down the kubelet so it only accepts instructions from your cluster’s API Server. In this guide, you’ll learn how to:
  • Install and configure the kubelet securely
  • Inspect its running configuration
  • Harden authentication, authorization, and network access

1. Role & Installation of the Kubelet

Key Responsibilities

  1. Node Registration
  2. Pod Lifecycle Management
  3. Health Reporting

Manual Installation

Download the kubelet binary and set up a systemd unit:
With kubeadm (v1.10+), most flags migrate into /var/lib/kubelet/config.yaml and are maintained automatically during kubeadm join.

Dedicated Config File

Add --config=/var/lib/kubelet/config.yaml to your service’s ExecStart. Command-line flags will always override the YAML settings.

2. Inspecting the Active Configuration

On any worker node, verify the kubelet invocation and configuration:

3. Kubelet API Endpoints

The image shows a table titled "Kubelet" with two ports, 10250 and 10255, and their descriptions regarding API access.
Anyone with network access to port 10255 can scrape metrics:
Port 10255 is unauthenticated and exposes sensitive metrics. It should always be disabled in production.

4. Authentication Configuration

By default, the kubelet permits anonymous requests (system:anonymous). Disable this to force clients to present credentials.

Disable Anonymous Access

Via flags in your systemd unit:
Or in /var/lib/kubelet/config.yaml:

Certificate-Based Client Auth

  1. Generate a CA and sign a kubelet-serving certificate.
  2. Distribute the CA bundle with --client-ca-file=/path/to/ca.crt.
  3. Test with:
  4. Ensure the API Server has credentials to call the kubelet:

5. Authorization Modes

Out of the box, the kubelet uses AlwaysAllow (no authorization). Switch to Webhook to delegate decisions to the API Server.
Each kubelet request is then validated via the API Server’s SubjectAccessReview endpoint.

6. Disabling the Read-Only Port

To completely turn off port 10255:
Always set readOnlyPort: 0 in production to prevent unauthenticated access to metrics.

7. Summary of Hardening Steps

Example Final kubelet.service Snippet

Example Final config.yaml

You’re now ready to apply these settings and secure the kubelet in your cluster!

Watch Video

Practice Lab