PortGate

Resources · Port reference · port 10250

Port 10250 (kubelet): what it is and how to secure it

Port 10250 is the kubelet API on every Kubernetes node. With anonymous access on, anyone who reaches it can run commands in your pods.

Check command

curl -sk https://127.0.0.1:10250/pods -o /dev/null -w "%{http_code}\n"

Copied.

Port 10250 is the kubelet API that runs on every Kubernetes node. It should be reachable only from the control plane, and it must refuse anonymous requests. A kubelet that accepts anonymous requests lets anyone list pods and run commands inside them.

What port 10250 is for

The kubelet is the agent on each node that starts containers. The API server talks to it on 10250 for kubectl logs, kubectl exec and metrics. Older clusters also had a read-only port, 10255, with no authentication at all.

Why an open kubelet is dangerous

If the kubelet has authentication.anonymous.enabled: true and authorization.mode: AlwaysAllow, which are the kubelet's own defaults when nothing else sets them, then anyone who can reach 10250 can:

  • list every pod on the node, with environment variables that often hold secrets;
  • call the /run and /exec endpoints to run commands inside any container;
  • read container logs.

kubeadm and managed services such as EKS, GKE and AKS turn anonymous access off, but hand-built clusters, old installs and some lightweight distributions do not always.

Check yours

On a node, ask the kubelet as an anonymous client:

curl -sk https://127.0.0.1:10250/pods -o /dev/null -w "%{http_code}\n"

401 means anonymous access is off. 200 means anyone who reaches the port can read your pods. Check the settings directly:

sudo grep -A3 -E "anonymous|authorization|readOnlyPort" /var/lib/kubelet/config.yaml
sudo ss -tlnp | grep -E "10250|10255"

Then test from outside the cluster:

curl -sk https://NODE_PUBLIC_IP:10250/pods -o /dev/null -w "%{http_code}\n"

Anything other than a timeout means the port is public.

Fix it

In the kubelet config file, usually /var/lib/kubelet/config.yaml:

authentication:
  anonymous:
    enabled: false
  webhook:
    enabled: true
authorization:
  mode: Webhook
readOnlyPort: 0
sudo systemctl restart kubelet

Then restrict the port at the network level: allow 10250 only from the control plane nodes, using your provider's security group or firewall. Nodes should not have 10250 reachable from the internet at all.

Common mistakes

  • Nodes with public IPs and an open security group for "all traffic from anywhere" during setup.
  • Leaving the read-only port 10255 on. It leaks pod details with no login.
  • Assuming the managed control plane covers the nodes. Your node security groups are still yours to set.

FAQ

Is 10250 open on EKS, GKE or AKS? Their defaults turn anonymous access off and keep nodes in private networks. Check your own security group rules.

What is port 10255? The deprecated read-only kubelet port. Set readOnlyPort: 0 and close it.

How do I get warned? PortGate's Server Guard alerts when 10250, 10255 or the API server port 6443 listens on a public address.