-
Notifications
You must be signed in to change notification settings - Fork 39.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kubeadm: add support for separate super-admin.conf kubeconfig file #121305
kubeadm: add support for separate super-admin.conf kubeconfig file #121305
Conversation
|
Skipping CI for Draft Pull Request. |
63e9a8d
to
8c413c8
Compare
c4eb331
to
55fd7a6
Compare
|
/milestone v1.29 |
|
Can you pls squash the last commit or just rename the subject? it's now "kubeconf". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
LGTM label has been added. Git tree hash: b8bbb7f264d386b202fd9c1dbe5447c0047a841c
|
- Register the new file in /certs/renewal, so that the file is renewed if present. If not present the common message "MISSING" is shown. Same for other certs/kubeconfig files. - In /kubeconfig, update the spec for admin.conf to use the "kubeadm:cluster-admins" Group. A new spec is added for the "super-admin.conf" file that uses the "system:masters" Group. - Add a new function EnsureAdminClusterRoleBinding() that includes logic to ensure that admin.conf contains a User that is properly bound on the "cluster-admin" built-in ClusterRole. This requires bootstrapping using the "system:masters" containing "super-admin.conf". Add detailed unit tests for this new logic. - In /upgrade#PerformPostUpgradeTasks() add logic to create the "admin.conf" and "super-admin.conf" with the new, updated specs. Add detailed unit tests for this new logic. - In /upgrade#StaticPodControlPlane() ensure that renewal of "super-admin.conf" is performed if the file exists. Update unit tests.
- Update unit tests in certs_test.go related to the "renew" CLI command. - In /init, (d *initData) Client(), make sure that the new logic for bootstrapping an "admin.conf" user is performed, by calling EnsureAdminClusterRoleBinding() from the phases backend. Add a "adminKubeConfigBootstrapped" flag that helps call this logic only once per "kubeadm init" binary execution. - In /phases/init include a new subphase for generating the "super-admin.conf" file. - In /phases/reset make sure the file "super-admin.conf" is cleaned if present. Update unit tests.
6449ac9
to
8370901
Compare
updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/unhold
unhold as there is 2* LGTM on this already
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chendave, neolit123 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@chendave @SataQiu @neolit123 We have a failure on master-informing board, looks like it is related to this PR, #121587 |
|
seems related, i will comment there. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
TL;DR, add a new "super-admin.conf" file that has super powers.
make the file "admin.conf" to be a regular admin user, instead of having the super powers.
see release note and commit text for the included commits.
Which issue(s) this PR fixes:
xref kubernetes/kubeadm#2414
Special notes for your reviewer:
NONE
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: