-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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-certs: fix wrong info about admin.conf #48095
Merged
k8s-ci-robot
merged 1 commit into
kubernetes:main
from
neolit123:1.32-fix-wrong-info-about-admin.conf
Sep 26, 2024
+15
−5
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -349,14 +349,24 @@ CSRs requesting serving certificates for any IP or domain name. | |
|
||
## Generating kubeconfig files for additional users {#kubeconfig-additional-users} | ||
|
||
During cluster creation, kubeadm signs the certificate in the `admin.conf` to have | ||
`Subject: O = system:masters, CN = kubernetes-admin`. | ||
During cluster creation, `kubeadm init` signs the certificate in the `super-admin.conf` | ||
to have `Subject: O = system:masters, CN = kubernetes-super-admin`. | ||
[`system:masters`](/docs/reference/access-authn-authz/rbac/#user-facing-roles) | ||
is a break-glass, super user group that bypasses the authorization layer (for example, | ||
[RBAC](/docs/reference/access-authn-authz/rbac/)). | ||
Sharing the `admin.conf` with additional users is **not recommended**! | ||
[RBAC](/docs/reference/access-authn-authz/rbac/)). The file `admin.conf` is also created | ||
by kubeadm on control plane nodes and it contains a certificate with | ||
`Subject: O = kubeadm:cluster-admins, CN = kubernetes-admin`. `kubeadm:cluster-admins` | ||
is a group logically belonging to kubeadm. If your cluster uses RBAC | ||
(the kubeadm default), the `kubeadm:cluster-admins` group is bound to the | ||
[`cluster-admin`](/docs/reference/access-authn-authz/rbac/#user-facing-roles) ClusterRole. | ||
|
||
Instead, you can use the [`kubeadm kubeconfig user`](/docs/reference/setup-tools/kubeadm/kubeadm-kubeconfig) | ||
{{< warning >}} | ||
Avoid sharing the `super-admin.conf` or `admin.conf` files. Instead, create least | ||
privileged access even for people who work as administrators and use that least | ||
privilege alternative for anything other than break-glass (emergency) access. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay. Please state what "least privilege alternative" means. Or else, this suggestion is not actionable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sftim suggested this change. |
||
{{< /warning >}} | ||
|
||
You can use the [`kubeadm kubeconfig user`](/docs/reference/setup-tools/kubeadm/kubeadm-kubeconfig) | ||
command to generate kubeconfig files for additional users. | ||
The command accepts a mixture of command line flags and | ||
[kubeadm configuration](/docs/reference/config-api/kubeadm-config.v1beta4/) options. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What does this mean?
kubeadm
is a CLI tool. Why there is a group belonging to a tool?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.
Some design details in https://github.com/kubernetes/enhancements/tree/master/keps/sig-cluster-lifecycle/kubeadm/4214-separate-super-user-kubeconfig#proposal.
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.
The "kubeadm:cluster-admins is a group logically belonging to kubeadm" statement is confusing. You can say that this group is created and used by kubeadm. Having a group belonging to a CLI tool is confusing.
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.
group is a term from rbac.