kubernetes/cmd/kubeadm/app/phases/kubelet
Lubomir I. Ivanov b117a928a6 kubeadm: prevent bootstrap of nodes with known names
If a Node name in the cluster is already taken and this Node is Ready,
prevent TLS bootsrap on "kubeadm join" and exit early.

This change requires that a new ClusterRole is granted to the
"system:bootstrappers:kubeadm:default-node-token" group to be
able get Nodes in the cluster. The same group already has access
to obtain objects such as the KubeletConfiguration and kubeadm's
ClusterConfiguration.

The motivation of this change is to prevent undefined behavior
and the potential control-plane breakdown if such a cluster
is racing to have two nodes with the same name for long periods
of time.

The following values are validated in the following precedence
from lower to higher:
- actual hostname
- NodeRegistration.Name (or "--node-name") from JoinConfiguration
- "--hostname-override" passed via kubeletExtraArgs

If the user decides to not let kubeadm know about a custom node name
and to instead override the hostname from a kubelet systemd unit file,
kubeadm will not be able to detect the problem.
2020-01-26 18:50:54 +02:00
..
BUILD kubeadm: Group centric component configs 2019-11-26 13:55:28 +02:00
config_test.go kubeadm: Group centric component configs 2019-11-26 13:55:28 +02:00
config.go kubeadm: Group centric component configs 2019-11-26 13:55:28 +02:00
dynamic_test.go move pkg/kubelet/apis/well_known_labels.go to staging/src/k8s.io/api/core/v1/ 2019-02-05 13:39:07 -05:00
dynamic.go kubeadm: Add ability to retry ConfigMap get if certain errors happen 2019-06-12 17:49:27 +02:00
flags_test.go kubeadm: prevent bootstrap of nodes with known names 2020-01-26 18:50:54 +02:00
flags.go kubeadm: prevent bootstrap of nodes with known names 2020-01-26 18:50:54 +02:00
kubelet.go kubeadm: enable kubelet client certificate rotation on primary CP nodes 2019-11-13 15:49:33 +02:00