More Info:
The kubelet —read-only-port argument should be set to 0 to disable the unauthenticated read-only port. This port exposes node and pod information without authentication.Risk Level
HighAddress
SecurityCompliance Standards
- CIS OKE
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every worker node, open the kubelet systemd drop-in config for editing:
-
In the
ExecStart=line, ensure the kubelet is started with the read-only port disabled. Add--read-only-port=0if it is missing, or change its value if present. For example: -
If the kubelet config file
/etc/kubernetes/kubelet-config.jsoncontains areadOnlyPortfield, set it to0(or remove the field so the flag value is authoritative). For example:Ensure it looks like: -
Reload systemd and restart kubelet on the worker node:
-
Confirm kubelet is running correctly:
-
Verify on the same worker node that the kubelet process includes
--read-only-port=0:Check the output and ensure--read-only-port=0is present and there is no conflicting--read-only-portwith a nonzero value.
Using kubectl
Using kubectl
kubectl cannot modify kubelet process flags or the host-level config file
/etc/kubernetes/kubelet-config.json on worker nodes. To set --read-only-port=0, you must update the kubelet’s systemd configuration under /etc/systemd/system/kubelet.service.d/00-default.conf on every worker node and then restart kubelet; see the Manual Steps section for exact commands.Automation
Automation
- Copy this script to every worker node (for example
/root/fix-kubelet-readonly-port.sh). - Run as root on every worker node:

