More Info:
Do not override node hostnames.Risk Level
HighAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every worker node, check for a hostname override in the running kubelet process:
-
On every worker node, edit the kubelet systemd drop-in to remove any
--hostname-overrideflag fromKUBELET_SYSTEM_PODS_ARGS:- In the
Environment="KUBELET_SYSTEM_PODS_ARGS=..."line, delete--hostname-override=...(and any trailing spaces). - Save and exit.
- In the
-
On every worker node, confirm that no
--hostname-overrideremains in the drop-in: -
On every worker node, reload systemd and restart kubelet (this will restart the kubelet and may briefly impact node status/workload scheduling):
-
On every worker node, if
/var/lib/kubelet/config.yamlis used, ensure it does not specify a hostname override (field may be absent or empty, but must not be explicitly overriding): -
On every worker node, verify that the running kubelet no longer has a hostname override argument:
Using kubectl
Using kubectl
kubectl cannot modify kubelet process flags or host-level configuration files such as
/etc/systemd/system/kubelet.service.d/10-kubeadm.conf or /var/lib/kubelet/config.yaml, so this finding cannot be fixed via the Kubernetes API. To remediate, make the change directly on each worker node as described in the Manual Steps section.Automation
Automation

