Skip to content

Commit bd9b792

Browse files
committed
kubeadm: add missing RBAC for getting nodes on "upgrade apply"
b117a92 added a new check during "join" whether a Node with the same name exists in the cluster. When upgrading from 1.17 to 1.18 make sure the required RBAC by this check is added. Otherwise "kubeadm join" will complain that it lacks permissions to GET a Node.
1 parent d5dfb5c commit bd9b792

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/kubeadm/app/phases/upgrade/postupgrade.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ func PerformPostUpgradeTasks(client clientset.Interface, cfg *kubeadmapi.InitCon
7070
errs = append(errs, errors.Wrap(err, "error uploading crisocket"))
7171
}
7272

73+
// Create RBAC rules that makes the bootstrap tokens able to get nodes
74+
if err := nodebootstraptoken.AllowBoostrapTokensToGetNodes(client); err != nil {
75+
errs = append(errs, err)
76+
}
77+
7378
// Create/update RBAC rules that makes the bootstrap tokens able to post CSRs
7479
if err := nodebootstraptoken.AllowBootstrapTokensToPostCSRs(client); err != nil {
7580
errs = append(errs, err)

0 commit comments

Comments
 (0)