Review kubelet hostname override settings

Keep the node identity consistent with authentication and operational configuration.

Description

--hostname-override supplies a node name to the kubelet, but a cloud provider may determine the registered name instead. Compare the actual Node name with your inventory. With Node authorization, verify that <nodeName> in the kubelet client identity system:node:<nodeName> matches the registered name exactly.

Potential impact

A name mismatch can prevent registration or authorized API access even when the client certificate authenticates. Changing an existing node’s identity can also disrupt workloads.

Remediation

Keep an override if the environment requires it. Otherwise use the default name. If removing it will rename an existing node, plan workload migration and node replacement or re-registration. Verify that the node registers under the intended name.

Examples

The examples remove the argument that selects node-a. The foo/bar image is a placeholder. Apply the change to the node’s actual kubelet startup settings.

Before

yaml
apiVersion: v1
kind: Pod
metadata:
  name: kubelet
spec:
  containers:
    - name: kubelet
      image: foo/bar
      command:
        - kubelet
      args:
        - --hostname-override=node-a

After

yaml
apiVersion: v1
kind: Pod
metadata:
  name: kubelet
spec:
  containers:
    - name: kubelet
      image: foo/bar
      command:
        - kubelet
      args: []

References