More Info:
Disable the read-only port.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every worker node, check how kubelet is configured (file vs flags):
Inspect the command line: if you see
--config=/var/lib/kubelet/config.yamlit is using the config file; if you see--read-only-port=it is using flags. -
If using the kubelet config file, edit it to disable the read-only port:
If there is no
readOnlyPortline, add it under the top-levelkubeletConfigurationblock, for example: -
If using command-line arguments, edit the kubelet systemd drop-in on each worker node:
If
--read-only-portis missing, add it to theKUBELET_SYSTEM_PODS_ARGS(or the line with other--flags), for example: -
On every worker node, reload systemd and restart kubelet (this will restart the kubelet and may briefly impact pod scheduling/health reporting on that node):
-
Verify on every worker node that kubelet is running with the read-only port disabled:
Confirm either that:
- the kubelet command line contains
--read-only-port=0, or - kubelet is using
/var/lib/kubelet/config.yamland that file containsreadOnlyPort: 0.
- the kubelet command line contains
Using kubectl
Using kubectl
kubectl cannot modify kubelet process flags or its config file on worker nodes; this setting must be changed directly on each node’s
/var/lib/kubelet/config.yaml or in the kubelet systemd unit. Refer to the Manual Steps section for the exact on-node configuration and restart instructions.Automation
Automation

